Convert Visio to PDF in Java

Convert Visio to PDF in Java

Are you looking to convert Visio to PDF in Java programmatically? This blog post will teach you how to manipulate and convert VSD/VSDX files to PDF file format using a few lines of code in Java. Visio diagrams are widely used to generate various designs of business processes and workflows. However, you need to transform your visio diagrams to other popular file formats such as PDF, PNG and more. This Java Visio API offers a wide range of classes and methods to achieve this functionality.

We will cover the following points in this article:

Java Visio API installation

This library is easy to install and offers comprehensive documentation where you can find a huge stack of methods and installation instructions. However, you can enable this API by either downloading the JAR files or following Maven configurations mentioned below:

    <name>Aspose Java API</name>


How to convert Visio to PDF in Java

Visio diagrams offer rich modeling features for creating process diagrams. In this section, we are going to go through the steps and the code snippets to convert VSD to PDF programmatically.

You may follow the steps mentioned below:

  1. Call the Diagram constructor to load the diagram from a VSD file.
  2. Invoke the save method to save as PDF file format.

You can see the output in the image below:

VSDX to PDF in Java

VSDX to PDF in Java

Visio to PDF conversion - advanced options

You can also configure the API calls as per your business requirements.

We will explore some key features by following the steps and the code snippets:

  1. Create an object of the Diagram class to load the diagram from a VSDX file.
  2. Instantiate an instance of PdfSaveOptions class to specify additional options when rendering diagram pages to PDF.
  3. Pass a value to the SplitMultiPages method to define whether split diagram to multi-pages according to page’s setting option.
  4. Specify the quality of JPEG compression for images by calling the setJpegQuality method.
  5. Invoke the setPageSize method to sets the page size for the generated images.
  6. Call the save method to save in PDF format.

Get a Free License

You can get a free temporary license to try the API without evaluation limitations.

Summing up

This brings us to the end of this article. Hope you have learned how to convert Visio to PDF in Java programmatically. In addition, we also have explored some advanced options that offer enterprise-level Visio to PDF conversion features. Moreover, you may visit the documentation of this Java Visio API to know about other methods. Further, is writing new blog posts on new topics. Therefore, please stay in touch for regular updates.

Ask a question

You can let us know about your questions or queries on our forum.


How do I convert a Visio file to PDF?

You can convert VSD/VSDX to PDF using this Java Visio API. It is rich-featured and offers a wide range of methods to convert Visio to PDF in Java.

How do I save a large Visio file as a PDF?

You can invoke the save method of this library to equip your Java application with a Visio to PDF converter. In addition, you can check the list here to know about other methods.

See Also