jar
jinlin
2025-03-04 23f02e6b45dd7cf0ab2e7827144913ca59575ea4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.example.client.service;
 
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
 
import java.io.IOException;
import java.io.InputStream;
 
public class CustomXWPFDocument extends XWPFDocument {
 
    public CustomXWPFDocument(InputStream in) throws IOException {
 
        super(in);
 
    }
 
    public CustomXWPFDocument() {
 
        super();
 
    }
 
    public CustomXWPFDocument(OPCPackage pkg) throws IOException {
 
        super(pkg);
 
    }
 
    /**
 
     @param id
 
     @param width
 
     宽
     1
     @param height
 
     高
     1
     @param paragraph
 
     段落
     1
     */
 
    public void createPicture(int id, int width, int height,
 
                              XWPFParagraph paragraph) {
 
        final int EMU = 9525;
 
        width *= EMU;
 
        height *= EMU;
 
/*        String blipId = getAllPictures().get(id).getPackageRelationship()
 
                .getId();*/
 
        CTInline inline = paragraph.createRun().getCTR().addNewDrawing()
 
                .addNewInline();
 
        String picXml = "";
    }
}