Html – Page break when HTML to PDF with AbcPdf

abcpdfhtmlpdf

I'm trying to create a report in PDF with abcPdf. Everything works but I would like to add a page number and margin at the bottom of each page as well as avoid cuts in the middle of a row as you can see in the picture:

page break

var theDoc = new Doc { TopDown = true };
var pageRef = theDoc.AddImageUrl(pdfUrl, true, 1903, true);
while (theDoc.Chainable(pageRef))
{
    theDoc.Page = theDoc.AddPage();
    //I guessI have to do something here???
    pageRef = theDoc.AddImageToChain(pageRef);
}

Does somebody know if it is possible?

Best Answer

It did work but I think AbcPdf is using the HTML rendering of IE so the best thing you can do is to manually set the rendering engine to be gecko (Dont forget that you need and extra DLL) or to update IE in your web server.

theDoc.HtmlOptions.Engine = EngineType.Gecko; 

Then to add a page break just use

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

Thanks to feeela for the comment.