Click or drag to resize
Pdf Library for .NET

Page Breaks

By default, the html to pdf converter offered by Select.Pdf Library automatically pages the content. The rendering engine decides where the page breaks fall, and the pagination is customized from the page's own CSS rather than from converter properties - see the sections below.

Manual Paging

Content pagination can be controlled from HTML/CSS. CSS styles can be used to manually change the pagination:

page-break-before: always

The "page-break-before" property sets whether a page break should occur BEFORE a specified element. The element can be anything (image, table, table row, div, text, etc).

XML
<div style="page-break-before: always">
A page break will be inserted BEFORE this div element
because "page-break-before" property is set to "always".
</div>

page-break-after: always

The "page-break-after" property sets whether a page break should occur AFTER a specified element. The element can be anything (image, table, table row, div, text, etc).

XML
<div style="page-break-after: always">
A page break will be inserted AFTER this div element
because "page-break-after" property is set to "always".
</div>

page-break-inside: avoid

The "page-break-inside" property sets whether a page break is allowed INSIDE a specified element. The element can be anything (image, table, table row, div, text, etc).

XML
<div style="page-break-inside: avoid">
The content of this div element will not be split into several pages (if possible)
because "page-break-inside" property is set to "avoid".
</div>
See Also