Visio object is not rendered correctly in HTML fotmat

Hi there


I am working on saving Word files into HTML format with Aspose Word 17.4
I met a Word file which contains Visio object, and its result does not render correctly.

Please refer my testing code and attachment, and help me find out how to improve it, thank you~

Craig

P.S. my code:

Document doc = new Document(“140702- Pusheen Mockup.docx”);
Document pageDoc;
LayoutCollector layoutCollector;
DocumentPageSplitter splitter;
ByteArrayOutputStream output = new ByteArrayOutputStream();
HtmlSaveOptions saveOp = new HtmlSaveOptions();
saveOp.setExportImagesAsBase64(true);
saveOp.setExportTextInputFormFieldAsText(false);
saveOp.setExportTocPageNumbers(true);
saveOp.setExportPageSetup(true);
saveOp.setExportDocumentProperties(true);
saveOp.setExportRelativeFontSize(false);
saveOp.setUpdateFields(true);
layoutCollector = new LayoutCollector(doc);
doc.updatePageLayout();
splitter = new DocumentPageSplitter(layoutCollector);

byte[] outputContent;
String outputPath = “”;
String blockId = UUID.randomUUID().toString();

File outputDir = new File(outputPath + “/” + blockId + “/”);
if (!outputDir.exists())
outputDir.mkdir();
ByteArrayOutputStream testOut = new ByteArrayOutputStream();

for (int page = 1; page <= doc.getPageCount(); page++) {
System.out.println(“page:” + page);
pageDoc = splitter.getDocumentOfPage(page);
Document onepageDoc = splitter.getDocumentOfPage(1);

testOut.reset();
output.reset();

pageDoc.save(output, saveOp);

outputContent = output.toByteArray();

IOUtils.write(outputContent, new FileOutputStream(outputPath + “/” + blockId + “/” + page + “.html”));
}

Hi Craig,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJAVA-1560. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.