For my current project, I was tasked with designing a print view using HTML & CSS. This view is then converted into a PDF on the server and sent to an A5 printer for physical output.
One of the specific requirements of this assignment is that the first page needs to be in Landscape orientation while all other pages should be Portrait.
I have successfully created the initial layout and set up a servlet which uses Flying Saucer to parse the HTML & CSS and generate the PDF. However, I am encountering difficulties when it comes to controlling the page orientation. In order to achieve the desired result, I have utilized the following CSS:
@page :first {size: A5 landscape}
@page{ size: A5 }
Although I have managed to get the first page displayed correctly in Landscape mode, all subsequent pages are being rendered as if they were in A3 landscape format but printed on A4 paper. Any insights on where I might be going wrong here would be greatly appreciated.