You can find more details at: Convert Visio VSD VSDX to Word DOC DOCX in Java
Last active
March 17, 2022 09:04
-
-
Save aspose-com-gists/9d1cd3f3065256f5639383cd4e8238fb to your computer and use it in GitHub Desktop.
Convert Visio VSD VSDX file to Word DOCX or DOC Document Programmatically in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a diagram object to load input VSD/VSDX Visio diagram | |
Diagram diagram = new Diagram("Diagram.vsd"); | |
// Create ByteArrayOutputStream and save the diagram as PDF | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
// Convert Visio VSD or VSDX to PDF format | |
diagram.save(baos, SaveFileFormat.PDF); | |
// Load the input PDF file from the ByteArrayOutputStream | |
com.aspose.pdf.Document document = new com.aspose.pdf.Document(baos.toByteArray()); | |
// Set properties for the output word document | |
DocSaveOptions options = new DocSaveOptions(); | |
options.setRecognizeBullets(true); | |
options.setFormat(DocFormat.Doc); | |
// Save output DOC Word file | |
document.save("Test.doc"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a diagram object to load input VSD/VSDX Visio diagram | |
Diagram diagram = new Diagram("Diagram.vsd"); | |
// Create ByteArrayOutputStream and save the diagram as PDF | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
// Convert Visio VSD or VSDX to PDF format | |
diagram.save(baos, SaveFileFormat.PDF); | |
// Load the input PDF file from the ByteArrayOutputStream | |
com.aspose.pdf.Document document = new com.aspose.pdf.Document(baos.toByteArray()); | |
// Set properties for the output word document | |
DocSaveOptions options = new DocSaveOptions(); | |
options.setRecognizeBullets(true); | |
options.setFormat(DocFormat.DocX); | |
// Save output DOCX Word file | |
document.save("Test.docx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment