Splitting PDF into Pages

I have a very long pdf with multiple tabs including multiple list controls.
I have managed to get it to print to PDF with the script below. This works perfectly, but the resulting file is one long page which then can't be printed onto paper.
How do I get it to paginate the file?
I am using the default button.
thank you!

fd.spRendered(function () {
// Set PDF export options for A4 Landscape
fd.pdfExportOptions = {
paperSize: 'A4', // Set paper size to A4
landscape: true, // Set orientation to landscape
scale: 1, // Set scale to 1 (no scaling)
margin: {
top: '10mm',
bottom: '10mm',
left: '10mm',
right: '10mm'
}
};
});

Hi @peter.harrison,

Try manually inserting page breaks into the PDF:

Thanks Ilia. I've tried that, but it isn't working. This is my script:

fd.spRendered(function () {
// Set PDF export options for A4 Landscape
fd.pdfExportOptions = {
paperSize: 'A4', // Set paper size to A4
landscape: true, // Set orientation to landscape
scale: 1, // Set scale to 1 (no scaling)
margin: {
top: '10mm',
bottom: '10mm',
left: '10mm',
right: '10mm'
},
forcePageBreak: '.page-break' // Add page breaks at specified elements
};
});

Hi @peter.harrison,

My bad, this only works with custom PDF buttons.