HTML Support for PDF Landing Pages
Page Breaks
To create a page break before an element, set the page-break-before style.
<p style="page-break-before: always;"> There will be a page break before this paragraph. </p>
To create a page break after an element, set the page-break-after style.
<p style="page-break-after: always;"> There will be a page break after this paragraph. </p>
To tell the renderer to avoid a page break inside of an element, set the page-break-inside style.
If necessary (and possible), the renderer will then move the whole element to the next page to avoid the page break inside of it.
<p style="page-break-inside: avoid;"> The renderer will attempt not to split this paragraph with page breaks. [more, longish content here... ... ...that is not supposed to be split] </p>
For widow control, set the widows style.
So called "widows" happen, if there is a page break inside of an element so that only a very few lines
fall onto the next page. The widows
style specifies, how many lines shall at least fall onto the next page,
if there happens to be a page break in the element. If fewer lines would fall onto the next page, then the
renderer inserts space into the element just before the specified number of widow lines, to push them
all onto the next page.
<p style="widows: 4;"> If a page break should occur in this paragraph, then the renderer will attempt to make sure that at least four (4) lines fall onto the next page. [more, longish content here... ... ...that is not supposed to leave widow lines] </p>
For orphan control, set the orphans style.
So called "orphans" happen, if there is a page break inside of an element so that only a very few lines
remain on the previous page. The orphans
style specifies, how many lines shall at least remain on the previous
page, if there happens to be a page break in the element. If that is not possible, then the renderer will move
the whole element onto the next page.
<p style="orphans: 5;"> If a page break should occur in this paragraph, then the renderer will attempt to make sure that at least five (5) lines remain on the previous page. [more, longish content here... ... ...that is not supposed to create orphan lines] </p>
For a similar, but more fine grained effect as the orphan control, use the -fs-page-break-min-height style. It allows you to specify how much of the block must show before the page break. If this is not possible, then the renderer will move the whole element onto the next page.
<p style="-fs-page-break-min-height:2cm;"> If a page break should occur in this paragraph, then the renderer will attempt to make sure that at least 2cm in height remain on the previous page. [more, longish content here... ... ...that is not supposed to leave too little content on the previous page] </p>