fix: 拆分拆不出图片问题
This commit is contained in:
@@ -657,6 +657,22 @@ public class FileSpiltService {
|
|||||||
c.selectPath("./*");
|
c.selectPath("./*");
|
||||||
while (c.toNextSelection()) {
|
while (c.toNextSelection()) {
|
||||||
XmlObject o = c.getObject();
|
XmlObject o = c.getObject();
|
||||||
|
if(o.getDomNode().getNodeName().equals("mc:AlternateContent")){
|
||||||
|
String str = o.toString();
|
||||||
|
String imgId = "";
|
||||||
|
Pattern pattern = Pattern.compile("r:embed=\"([^\"]+)\"");
|
||||||
|
Matcher matcher = pattern.matcher(str);
|
||||||
|
// 查找匹配项
|
||||||
|
if (matcher.find()) {
|
||||||
|
// 提取捕获组中的内容
|
||||||
|
String result = matcher.group(1);
|
||||||
|
imgId = result;
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(imgId)){
|
||||||
|
imageBundleList.add(imgId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
//如果子元素是<w:drawing>这样的形式,使用CTDrawing保存图片
|
//如果子元素是<w:drawing>这样的形式,使用CTDrawing保存图片
|
||||||
if (o instanceof CTDrawing) {
|
if (o instanceof CTDrawing) {
|
||||||
CTDrawing drawing = (CTDrawing) o;
|
CTDrawing drawing = (CTDrawing) o;
|
||||||
|
|||||||
Reference in New Issue
Block a user