Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于 Apache POI,我正在阅读 Word 文档,包括 doc 和 docx。doc 的旧 CharacterRun 有一个 isHighlighted 函数,它告诉我文本是否突出显示。对于 docx 文件,XWPFRun 是否有等效功能?
经过大量的研究和分析,我能够弄清楚CTRPr类中有一个函数。
//p is the XWPFParagraph for (XWPFRun pRun : p.getRuns()) { CTRPr ctrpr = pRun.getCTR().getRPr(); if (ctrpr != null && ctrpr.isSetHighlight()) { //This is highlighted } }