I dont know about iTextSharp specifically, but a next version of the library from creators of iTextSharp does HTML to PDF conversion correctly. It is called iText7 (Incompatible with previous iTextSharp); here is HTML to PDF package: https://www.nuget.org/packages/itext7.pdfhtml/
Usage:
HtmlConverter.ConvertToPdf(
new FileInfo(@"Path\to\Html\File.html"),
new FileInfo(@"Path\to\Pdf\File.pdf")
);
(method has many other overloads too).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.