Page Breaks not working as expected in PDF

Page breaks not working when fields are in multiple accordions/layouts and included them in a section to render into pdf. below are the steps.

Add Multiple accordions in a section.
Add Custom CSS in pyCompactStylesforPDF Text file ( .page_break_avoid{ page-break-inside:avoid !important; })
Add page break css method on each accordion .
create a PDF using OOTB utility

Page breaks are displaying in the middle of the layouts/sections.

@SriK3119 please could you specify your Pega version? You may need to check our Resolved Issues pages for any PDF fixes and enhancements made to the upgraded PD4ML . For example here or here.

See this old support article and this old support article.

We support a parameter pyEnableSmartTableBreaks that toggles the underlying PD4ML option of smart table breaks. This will allow the table to be rendered correctly across pages.

For the latest documentation please see Troubleshooting HTML-to-PDF Conversion issues