# Multi-Page Content

The PDF Export component provides options for generating multi-page content in PDF, preventing the page-split, and rendering page templates.

<Row>
  <Column count={[24,24,12]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#manual-page-breaking">
      <ComponentTitle>Manual Page Breaking</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Manually specify page breaks using the forcePageBreak CSS selector property.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,12]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#automatic-page-breaking">
      <ComponentTitle>Automatic Page Breaking</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Enable automatic page break insertion by setting the paperSize option.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,12]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#page-templates">
      <ComponentTitle>Page Templates</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Add custom templates to each page with page number and total page count.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,12]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#preventing-page-breaking-in-elements">
      <ComponentTitle>Preventing Page Breaking in Elements</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Keep specific elements intact using the keepTogether option with CSS selectors.</ComponentDescription>
    </Component>
  </Column>
</Row>

For more information on how to render multi-page content with the Drawing library, refer to its [PDF output documentation](https://www.telerik.com/kendo-angular-ui/components/drawing/pdf-output/multi-page-content).

## Manual Page Breaking

To manually specify the page breaks, set the [`forcePageBreak`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent#forcepagebreak) property. As a result, a page break, which matches the `forcePageBreak` CSS selector, occurs before each element.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/pdf-export/manual-paging/source.txt)

## Automatic Page Breaking

The PDF Export component supports automatic page breaking. To automatically insert page breaks, set the [`paperSize`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent#papersize) option. You will still be able to apply the [`forcePageBreak`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent#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](https://www.telerik.com/kendo-angular-ui/components/drawing/limitations-browser-support).

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/pdf-export/auto-paging/source.txt)

## Page Templates

When you request multi-page output through the [`forcePageBreak`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent#forcepagebreak) or [`paperSize`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent#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`).

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/pdf-export/page-template/source.txt)

## Preventing Page Breaking in Elements

To prevent specific elements from being split across pages, use the [`keepTogether`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent#keeptogether) option. `keepTogether` accepts CSS selectors that are passable to [`querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/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](https://www.telerik.com/kendo-angular-ui/components/drawing/pdf-output/multi-page-content).

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/pdf-export/keep-together/source.txt)

## Suggested Links

* [API Reference of the PDF Export Component](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent)
* [Rendering Multi-Page Content with the Drawing Library](https://www.telerik.com/kendo-angular-ui/components/drawing/pdf-output/multi-page-content)
