过滤识别不出得字体大小

This commit is contained in:
wuchunlei
2025-04-22 17:33:56 +08:00
parent 02e41cbb08
commit a0e576d435

View File

@@ -424,6 +424,7 @@ public class BookController {
XWPFParagraph paragraph = (XWPFParagraph) element;
String text = paragraph.getText();
if (text != null && !text.isEmpty()) {//处理段落或正文
if (paragraph.getRuns().size() > 0){
if (heading1Llist.contains(text)||paragraph.getRuns().get(0).getFontSize()>=topText){//判断是否是顶级标题
chapterName = text;
BookChapterEntity bookChapter = new BookChapterEntity();
@@ -466,6 +467,7 @@ public class BookController {
contentsBatch.add(contentEntity);
}
}
}
} else {// 顺序遍历图片
List<IRunElement> runs = paragraph.getIRuns();
for (IRunElement run : runs) {