问题
I using iTextSharp (V 5.4.2.0) to convert a html page to pdf. But I would like to be able to set a new page.
I've tried this:
<div style="page-break-before:always"> </div>
and the tag <newpage />
But it doesn't work. What is the best way, to create a html page, including new page tags (or something) to be able to convert it correctly using iTextSharp?
Kind regards,
Matthijs
回答1:
Use the iTextSharp XML Worker library and then use this HTML:
<div style="page-break-before:always"> </div>
回答2:
A <np />
tag in your HTML inserts a page break in the Document/PDF.
回答3:
Use this in C# document.NewPage();
来源:https://stackoverflow.com/questions/17043029/set-new-page-in-html-using-itextsharp-htmlworker-html-to-pdf