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