Multi-Page Content
The PDF Export component provides options for generating multi-page content in PDF, preventing the page-split, and rendering page templates.
For more information on how to render multi-page content with the Drawing library, refer to its PDF output documentation.
Manual Page Breaking
To manually specify the page breaks, set the forcePageBreak
property. As a result, a page break, which matches the forcePageBreak
CSS selector, occurs before each element.
Automatic Page Breaking
The PDF Export component supports automatic page breaking. To automatically insert page breaks, set the paperSize
option. You will still be able to apply the forcePageBreak
configuration to manually specify the break points.
For more information, refer to the known limitations of the Drawing library and the PDF Export component.
Page Templates
When you request multi-page output through the forcePageBreak
or paperSize
options, you can additionally specify a page template. The page template is inserted into each page before the output is produced and you can position it relatively to the page by using CSS. The template receives the number of the current page (pageNum
) and the total number of pages (totalPages
).
Preventing Page Breaking in Elements
To prevent specific elements from being split across pages, use the keepTogether
option. keepTogether
accepts CSS selectors that are passable to querySelector
.
All elements from the following example which have the "prevent-split"
CSS class are kept within the boundaries of the pages and their content is not split. If they fall on a margin, they will be moved to the next page.
For more information on existing issues in element behavior during page breaking, refer to the article about known limitations and browser support.