fix 文档拆分失败
This commit is contained in:
+12
-12
@@ -154,17 +154,17 @@ public class FileSpiltService {
|
||||
ZipSecureFile.setMinInflateRatio(-1.0d);
|
||||
XWPFDocument doc = new XWPFDocument(is);
|
||||
// 获取文档中的图片
|
||||
List<XWPFPictureData> allPictures = doc.getAllPictures();
|
||||
// 遍历图片并处理数学公式
|
||||
for (XWPFPictureData pictureData : allPictures) {
|
||||
String contentType = pictureData.getPackagePart().getContentType();
|
||||
System.out.println(contentType);
|
||||
// 判断图片类型是否为数学公式
|
||||
if (contentType.equals(PictureType.EMF.getExtension())) {
|
||||
// 处理数学公式,你可以在这里添加自己的逻辑
|
||||
System.out.println("Found a math equation!");
|
||||
}
|
||||
}
|
||||
//List<XWPFPictureData> allPictures = doc.getAllPictures();
|
||||
//// 遍历图片并处理数学公式
|
||||
//for (XWPFPictureData pictureData : allPictures) {
|
||||
// String contentType = pictureData.getPackagePart().getContentType();
|
||||
// System.out.println(contentType);
|
||||
// // 判断图片类型是否为数学公式
|
||||
// if (contentType.equals(PictureType.EMF.getExtension())) {
|
||||
// // 处理数学公式,你可以在这里添加自己的逻辑
|
||||
// System.out.println("Found a math equation!");
|
||||
// }
|
||||
//}
|
||||
//获得序号标题和无标题序号
|
||||
TitleNumberVO titleNumberVO = AsposeUtil.getNumber(is1);
|
||||
//TitleNumberVO titleNumberVO = new TitleNumberVO();
|
||||
@@ -427,7 +427,7 @@ public class FileSpiltService {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(),e);
|
||||
return -1;
|
||||
}
|
||||
if (treeList.size() > 0 && messageList.size() > 0) {
|
||||
|
||||
@@ -144,6 +144,9 @@ public class ReadWordTable {
|
||||
if (tcPr.getVMerge() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal() == null){
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal().toString().equalsIgnoreCase("continue")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user