Install a new page in HTML using iTextSharp HTMLWorker (html to pdf)

I am using iTextSharp (V 5.4.2.0) to convert an html page to pdf. But I would like to be able to set a new page.

I tried this:

<div style="page-break-before:always">&nbsp;</div> 

and tag <newpage />

But that will not work. What is the best way to create an html page, including new page tags (or something else) to be able to correctly convert it using iTextSharp?

Yours faithfully,

Matthijs

+8
html c # pdf itext itextsharp
source share
3 answers

Use iTextSharp XML Worker library , and then use this HTML code:

 <div style="page-break-before:always">&nbsp;</div> 
+27
source share
Tag

A <np /> in your HTML inserts a page break in a document / PDF.

0
source share

Use this in C # document.NewPage ();

0
source share

All Articles