我正在尝试创建一个包含多列的 Word 文档。这样做(而不是使用表格)的原因是数据将跨越多个页面,并且只有使用列我才能在添加到新页面之前填充整个页面。
可以用 Apache POI 来完成吗?谢谢!
最佳答案
使用之前创建的多列空文档怎么样?像这样:
XWPFDocument document = new XWPFDocument(PoiTest.class.getResourceAsStream("twocolumn.docx"));
XWPFParagraph tmpParagraph = document.getParagraphs().get(0);
for (int i = 0; i < 100; i++) {
XWPFRun tmpRun = tmpParagraph.createRun();
tmpRun.setText("LALALALAALALAAAA");
tmpRun.setFontSize(18);
}
document.write(new FileOutputStream(new File("C:\\temp\\poi.docx")));
关于java - Apache POI - Word (docx) 文档中的多列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14578288/