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 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.
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