Convert HTML to PDF in .NET

后端 未结 30 1833
不知归路
不知归路 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:48

    Most HTML to PDF converter relies on IE to do the HTML parsing and rendering. This can break when user updates their IE. Here is one that does not rely on IE.

    The code is something like this:

    EO.Pdf.HtmlToPdf.ConvertHtml(htmlText, pdfFileName);
    

    Like many other converters, you can pass text, file name, or Url. The result can be saved into a file or a stream.

提交回复
热议问题