Convert HTML to PDF in .NET

后端 未结 30 1904
不知归路
不知归路 2020-11-22 00:28

I want to generate a PDF by passing HTML contents to a function. I have made use of iTextSharp for this but it does not perform well when it encounters tables and the layout

30条回答
  •  走了就别回头了
    2020-11-22 00:51

    I'm the author of the Rotativa package. It allows to create PDF files directly from razor views:

    https://www.nuget.org/packages/Rotativa/

    Trivial to use and you have full control on the layout since you can use razor views with data from your Model and ViewBag container.

    I developed a SaaS version on Azure. It makes it even easier to use it from WebApi or any .Net app, service, Azure website, Azure webjob, whatever runs .Net.

    http://www.rotativahq.com/

    Free accounts available.

提交回复
热议问题