过滤识别不出得字体大小
This commit is contained in:
@@ -424,6 +424,7 @@ public class BookController {
|
|||||||
XWPFParagraph paragraph = (XWPFParagraph) element;
|
XWPFParagraph paragraph = (XWPFParagraph) element;
|
||||||
String text = paragraph.getText();
|
String text = paragraph.getText();
|
||||||
if (text != null && !text.isEmpty()) {//处理段落或正文
|
if (text != null && !text.isEmpty()) {//处理段落或正文
|
||||||
|
if (paragraph.getRuns().size() > 0){
|
||||||
if (heading1Llist.contains(text)||paragraph.getRuns().get(0).getFontSize()>=topText){//判断是否是顶级标题
|
if (heading1Llist.contains(text)||paragraph.getRuns().get(0).getFontSize()>=topText){//判断是否是顶级标题
|
||||||
chapterName = text;
|
chapterName = text;
|
||||||
BookChapterEntity bookChapter = new BookChapterEntity();
|
BookChapterEntity bookChapter = new BookChapterEntity();
|
||||||
@@ -466,6 +467,7 @@ public class BookController {
|
|||||||
contentsBatch.add(contentEntity);
|
contentsBatch.add(contentEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {// 顺序遍历图片
|
} else {// 顺序遍历图片
|
||||||
List<IRunElement> runs = paragraph.getIRuns();
|
List<IRunElement> runs = paragraph.getIRuns();
|
||||||
for (IRunElement run : runs) {
|
for (IRunElement run : runs) {
|
||||||
|
|||||||
Reference in New Issue
Block a user