Skip to main content
added sentence with link to safe/unsafe VF elements for PDF.
Source Link

Indeed there is a specific style attribute that creates page breaks at desired locations on the page.

<div style="page-break-before: always" />

Will move everything that appears after this DIV onto the next page.

There are also other similar page-break properties, you can see how they all work here.

Also note that pageblock table is not recommended to be used in a PDF, you better off replacing that with a normal HTML table using apex:repeat's. There is more information on what Visualforce elements are safe to use in a PDF here.

Indeed there is a specific style attribute that creates page breaks at desired locations on the page.

<div style="page-break-before: always" />

Will move everything that appears after this DIV onto the next page.

There are also other similar page-break properties, you can see how they all work here.

Also note that pageblock table is not recommended to be used in a PDF, you better off replacing that with a normal HTML table using apex:repeat's

Indeed there is a specific style attribute that creates page breaks at desired locations on the page.

<div style="page-break-before: always" />

Will move everything that appears after this DIV onto the next page.

There are also other similar page-break properties, you can see how they all work here.

Also note that pageblock table is not recommended to be used in a PDF, you better off replacing that with a normal HTML table using apex:repeat's. There is more information on what Visualforce elements are safe to use in a PDF here.

Source Link
Boris Bachovski
  • 16.3k
  • 8
  • 50
  • 88

Indeed there is a specific style attribute that creates page breaks at desired locations on the page.

<div style="page-break-before: always" />

Will move everything that appears after this DIV onto the next page.

There are also other similar page-break properties, you can see how they all work here.

Also note that pageblock table is not recommended to be used in a PDF, you better off replacing that with a normal HTML table using apex:repeat's