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 = "";
|
}
|
}
|