function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Fabien SchiettecatteFabien Schiettecatte 

Using page-break-inside: avoid; on Visualforce renderAs="pdf" page

When I used page-break-inside: avoid; on a <div> contianer in a Visualforce renderAs="pdf" page, it doesn't work as expected. It doesn't have any effect.

What I want to achieve is, when an element is spread out between 2 pages of the pdf, it is automatically put on the next page of the pdf, as if it would have page-break-before: always;.

Does anyone know of this bug, is there a workaround or did someone have good results using page-break-inside: avoid;?
Kiran  KurellaKiran Kurella
I have used page-break-inside: avoid; in a div rendered as a pdf and it worked fine.

Any of the following option should work

<div page-break-inside: avoid;">

<apex:outputPanel layout="block" style="page-break-inside: avoid;">