Make exported pdf into portrait when using page-breaks in Plumsail

Hi there,

I added a page break to the exported pdf using the following code:

fd.pdfOptions = {
landscape: false,
forcePageBreak: '.page-break'
};

Then I realized that in the exported pdf, the first page is in portrait mode and the second page is in landscape mode. How do I make the second page into portrait mode also?

Thanks,

Dear @jyou,
Looks strange, but make sure to also specify page size, like this:

fd.pdfOptions = {
    paperSize: 'A4',
    landscape: false,
    forcePageBreak: '.page-break'
};

Let me know if this makes any difference in your result.

@Nikita_Kurguzov ,

Thanks for your response. however, i realized when I added the paperSize, I ended up having pdf looking like the following with 6 pages instead of 2 pages. And the format is messed up also.

Please advise.

Thanks.

Dear @jyou,
Yes, it can be a challenge to adjust the PDF to work exactly as you want it to, as it's based on browser's printing functionality. You can experiment with different page sizes, and if this doesn't help, try adjusting styles with CSS. More on exporting to PDF here - How to save SharePoint form as PDF for printing — SharePoint forms