Last active
July 27, 2022 07:13
-
-
Save conholdate-gists/c22fd5a8a461acd2f046974b5504020b to your computer and use it in GitHub Desktop.
How to Convert Visio to PDF 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 an object of Diagram class to load diagram from a VSDX file | |
Diagram diagram = new Diagram( "sample.vsdx"); | |
// Instantiate an instance of PdfSaveOptions class to specify additional options when rendering diagram pages to PDF. | |
PdfSaveOptions options = new PdfSaveOptions(); | |
// pass a value to the SplitMultiPages method to define whether split diagram to multi pages according to page's setting. option | |
options.setSplitMultiPages(true); | |
// Specify the quality of JPEG compression for images by calling the setJpegQuality method | |
options.setJpegQuality(100); | |
// Invoke the setPageSize method to sets the page size for the generated images | |
options.setPageSize(null); | |
// Call the save method to save in PDF format | |
diagram.save( "SplitMultiPages.pdf", options); |
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
// Call the diagram constructor to load diagram from a VSD file | |
Diagram diagram = new Diagram("sample.vsdx"); | |
// Invoke the save method to save as PDF file format | |
diagram.save( "ExportToPDF_Out.pdf", SaveFileFormat.PDF); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment