如何使用apache poi

时间:2016-08-18 08:22:50

标签: apache-poi

我正在尝试为同一段落设置多个样式,但只应用一种样式。我想要应用多种样式

XWPFDocument document = new XWPFDocument(new FileInputStream("D:\\LatestStyleTemplates.docx"));
            out = new FileOutputStream(new File("D:\\createdocument.docx"));
            XWPFParagraph article = document.createParagraph();
            XWPFParagraph title = document.createParagraph();
            XWPFParagraph endnoteText = document.createParagraph();
            XWPFParagraph heading1 = document.createParagraph();
            endnoteText.setStyle("Strong");
            endnoteText.setStyle("EndnoteText");

1 个答案:

答案 0 :(得分:1)

每个段落只能有一个段落级别样式。如果需要覆盖段落样式的特定方面,则可以在运行中定义其他字符样式(每次运行最多一个)。

相关问题