修改拆分w:pict图片的情况

This commit is contained in:
高嵩
2024-09-07 13:28:24 +08:00
parent 22f6ac0aad
commit a9d395b60d
@@ -402,10 +402,13 @@ public class FileSpiltService {
}else if (StringUtils.isNotBlank(paragraphString) && titleNumberMap.containsKey(paragraphString)){
replaceNumberFlag = true;
List<String> stringList = titleNumberMap.get(paragraphString);
replaceNumber = stringList.get(0);
//replaceNumber = titleNumberMap.get(paragraphString);
paragraphString = replaceNumber + paragraphString;
stringList.remove(0);
if(CollectionUtils.isNotEmpty(stringList)){
replaceNumber = stringList.get(0);
//replaceNumber = titleNumberMap.get(paragraphString);
paragraphString = replaceNumber + paragraphString;
stringList.remove(0);
}
}
String startDigit;
if (replaceNumberFlag){
@@ -922,6 +925,22 @@ public class FileSpiltService {
c.selectPath("./*");
while (c.toNextSelection()) {
XmlObject o = c.getObject();
if(o.getDomNode().getNodeName().equals("w:pict")){
String str = o.toString();
String imgId = "";
Pattern pattern = Pattern.compile("v:imagedata r:id=\"([^\"]+)\"");
Matcher matcher = pattern.matcher(str);
// 查找匹配项
if (matcher.find()) {
// 提取捕获组中的内容
String result = matcher.group(1);
imgId = result;
}
if(StringUtils.isNotBlank(imgId)){
imageBundleList.add(imgId);
continue;
}
}
if(o.getDomNode().getNodeName().equals("mc:AlternateContent")){
String str = o.toString();
String imgId = "";