word插图visio
// Initialize a Diagram class
Diagram diagram = new Diagram("D:\\dbbg\\xxx.vsdx");
// Save diagram in the png format
diagram.save("D:\\dbbg\\Visio_out.png", SaveFileFormat.PNG);
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
File file = new File("D:\\dbbg\\Visio_out.png");
FileInputStream fileInputStream = new FileInputStream(file);
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
Shape shape = builder.insertOleObject("D:\\dbbg\\xxx.vsdx", "Visio.Drawing.15", false, true, bufferedInputStream);
shape.setWidth(682.5D);
shape.setHeight(366D);
shape.setHorizontalAlignment(HorizontalAlignment.CENTER);
doc.save("D:\\dbbg\\textPoiTl_ole_out.docx");