When I first tried to insert a single landscape page after several portrait pages and then switch back to portrait orientation, I encountered two issues:
- the mirrored margins are lost after the orientation changes,
- the vertical text inside the textbox located in the side header is not vertically centered on the page.
On the other hand, the tables and text in the top and bottom headers are correctly stretched and adjusted when the page orientation changes to landscape.
To create a single landscape page, I currently do the following:
1. In the last paragraph before the landscape page, I add a Portrait section.
2. I then add the content that should appear on the landscape page.
3. After that, I insert an empty paragraph with a Landscape section.
4. Finally, at the end of the document, there is Portrait section, which correctly switches all subsequent pages back to portrait orientation.
Each time I create a new section (the Portrait section before the landscape page and the Landscape section after it), I execute the following code:
- Code: Select all
newSection.getInternalType().getEGHdrFtrReferences().addAll(
existingSection.getInternalType().getEGHdrFtrReferences()
);
where existingSection is the section retrieved from the template for the preceding portrait pages.
Additionaly, the loss of mirrored margins affects all pages preceding the landscape page, up to the first page of document that has its own section. All pages following the landscape page, from that point to the end of the document, retain the correct mirrored margins.
Would any additional information be required to help diagnose this issue? For example, would it be helpful if I shared the relevant XML or a code snippet showing how the section properties are generated?

