We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Page Breaks not working with HtmlToPdfConverter

Hi There,

I am trying to use HtmlToPdfConverter from the Syncfusion.HtmlToPdfConverter46 nuget package with WebKit to save an HTML page to PDF.  If I try to add a page break using "page-break-after: always;", I just end up with it adding half a page of white space to the document, but with no page break.   Even testing with:
<div>
    hello world
</div>

<p style="page-break-after: always;"></p>
<div>
    hello world
</div>

Results in a document of length one page with "hello world" at the top, and halfway down the page.   Is there something I have missed in using the page break functionality?

Thanks

5 Replies

PV Prakash Viswanathan Syncfusion Team January 19, 2017 10:29 AM UTC

Hi Matt, 
 
Thanks for contacting Syncfusion support. 
 
We have fixed few similar issues related to page break in our WebKit HTML converter in our 2016 volume 3 release (Essential Studio version: 14.3.0.52). We have checked the reported functionalities in our current WebKit HTML converter with the input you have provided, it works fine. I have attached the output PDF document which is converted using latest WebKit HTML converter. If this behavior is acceptable, please upgrade to latest version of WebKit HTML converter. 
 
Latest WebKit HTML converter:  https://www.syncfusion.com/downloads/latest-version  
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Prakash V. 



MM Matt M January 19, 2017 11:54 AM UTC

Hi,

I have tried using WebKit HTML Converter versions 14.3.052, 14.4.0.15, and 14.4.0.20 but all of them have the problem with page breaks.  They all just add white space with no page break.  What was the exact version number you used to create your PDF?  What is the current version (14.4.0.15 or 14.4.0.20)?

Thanks


PV Prakash Viswanathan Syncfusion Team January 20, 2017 11:22 AM UTC

Hi Matt, 
 
Current version of WebKit HTML converter: 14.4.0.20 
 
I have generated the PDF using 14.4.0.15 version. I have attached a sample with 14.4.0.15 version. Please find the sample from below link, 
 
Note: We have made changes in QtBinaries in each version of WebKit HTML converter. Make sure you are using same version of QtBinaries and Syncfusion assemblies. 
 
If still the issue reproducing, please share us the code snippet and sample which will helpful for us to proceed further. 
 
Regards, 
Prakash V. 



MM Matt M January 20, 2017 01:07 PM UTC

Prakash,

You were right!  I needed to update my QtBinaries to match the version of the converter I was using.

The page breaks work perfectly now.

Thnkas


PV Prakash Viswanathan Syncfusion Team January 23, 2017 04:50 AM UTC

Hi Matt, 
 
Thanks for your update, please let us know if you need any further assistance. 
 
Regards, 
Prakash V. 


Loader.
Up arrow icon