Hi Aspose,
I am trying to insert some data to my valid Visio file as below:
private static void testInsertSolutionXML() throws Exception {Test_20171012.zip (122.3 KB)
System.out.println("testInsertSolutionXML");
try (InputStream in = new FileInputStream("D:\\tmp\\Tuyen\\Visio\\Test_20171012.vsdx");
OutputStream out = new FileOutputStream("D:\\tmp\\Tuyen\\Visio\\Test_20171012_SolutionXML.vsdx")) {
Diagram document = new Diagram(in);
SolutionXML newXML = new SolutionXML();
newXML.setName("Solution XML");
newXML.setXmlValue("<doc-id>id1</doc-id>");
document.getSolutionXMLs().add(newXML);
System.out.println("Getting back solution xml: " + document.getSolutionXMLs().get("Solution XML").getXmlValue());
document.save(out, SaveFileFormat.VSDX);
}
}
The problem is the output file has invalid Visio format, that happens with the attached file only.
I’m using Aspose Diagram for Java 17.5.0. Can you have a look? Thank you.
Best Regards,
Tuyen