I need to set landscape to some pages of a document. I tried this code:
SectPr sectionLandscape = objectFactory.createSectPr();
String rsidR = sectionLandscape.getRsidR();
SectPr sectionPortrait = objectFactory.createSectPr();
sectionPortrait.setRsidR(rsidR);
sectionPortrait.setRsidSect(rsidR);
PgSz landscape = new PgSz();
landscape.setOrient(STPageOrientation.LANDSCAPE);
landscape.setH(BigInteger.valueOf(11906));
landscape.setW(BigInteger.valueOf(16383));
sectionLandscape.setPgSz(landscape);
mdp.addObject(sectionLandscape);
It creates this xml code:
<w:sectPr>
<w:pgSz w:w="16383" w:orient="landscape" w:h="11906"/>
</w:sectPr>
And after of the Section tag have the text and the table that i need inside landscape page. With Word 2007/2010 i only see the portrait page and in editing mode of the page I can see the page selected as landscape.