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
close icon

Html to pdf - page break cut the text & CSS

How do I make the pdf to not cut the middle line if all the div did not enter until the end of the page.

I attach files:
1. html text.
2. convert code.
3. pdf file.

Attachment: Archive_595915d3.zip

1 Reply

KK Karthik Krishnaraj Syncfusion Team May 22, 2015 10:55 AM UTC

Hi Kobi,

Thank you for using syncfusion products,

IE based HTML to PDF converter supports detecting page-break-before: always; and page-break-after: always; types of page break.

When the HTML Pages uses these page breaks, then it can be detected by the HTML converter. I have attached a KB link which explains this scenario in the below link. Provided HTML document is of unsupported page break.

KB Link:
https://www.syncfusion.com/kb/4229/how-to-add-page-break-in-html-to-pdf-conversion

Here the output document provided is bitmapped(Not selectable text), hence the page break doesn’t work properly. For this you need to enable the legacy drawing. Html Converter converts Web pages to Image using MSHTML (IE Rendering Engine), and then convert to PDF. So the contents are displayed as image .

To solve this, the key FEATURE_IVIEWOBJECTDRAW_DMLT9_WITH_GDI should be updated in the registry. Please run the utility placed in the following location to perform the above changes automatically.

$system drive:\Program Files\Syncfusion\Essential Studio\$Version # \Utilities\PDF\Legacy Drawing

After these changes please try to convert the Html to PDF which will produce the sharper selectable text. Please check the below link for more information and let us know if issue still reproduces.

Link:

http://msdn.microsoft.com/en-us/library/ee330732(v=vs.85).aspx#iviewobject_draw

Thanks,

Karthik.


Loader.
Live Chat Icon For mobile
Up arrow icon