[英]Apache POI - multiple columns in a Word (docx) document
我正在尝试创建具有多列的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")));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.