我需要將橫向設置爲文檔的某些頁面。我想這樣的代碼:更改文檔中間的頁面方向
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);
它創建了一個XML代碼:
<w:sectPr>
<w:pgSz w:w="16383" w:orient="landscape" w:h="11906"/>
</w:sectPr>
與分區的標籤後,有文字和表格,我需要橫向頁面內。在Word 2007/2010中,我只能看到縱向頁面,並且在頁面的編輯模式下,我可以看到選爲橫向的頁面。
http://i.stack.imgur.com/HHuGB.png
不需要rsId的東西。 – JasonPlutext 2013-02-20 20:23:20