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

Specify a page break in code or CSS

I'm generating a PDF off a page with a lot of dynamic content.  I want to be able to ensure the page break happens in an acceptable place.  Is there a way to specify where in the HTML content a page breaks?  I tried using something like page-break-before CSS styles, but that doesn't affect the breaking.

1 Reply

GM Geetha M Syncfusion Team December 21, 2012 07:24 AM UTC

Hi Brian,

Thank you for your interest in Syncfusion products.

If the page breaks are specified in the HTML, then it can be applied in the converted PDF document by turning on the following property:

HtmlConverter.AutoDetectPageBreak = true;

By default, this property is set to false which makes the PDF to break only for the PdfPage size. Turning on this property will ensure page breaks in HTML along with PdfPage breaks.

Please try this and let me know if you have any questions.

Regards
Geetha

Loader.
Live Chat Icon For mobile
Up arrow icon