Convert Microsoft Visio Document to JPG in Java
Tags: java, visio, jpg, diagram
Published: 2018-11-11 11:10:44

---
title: Convert Microsoft Visio Document to JPG in Java
published: true
description: Convert Microsoft Visio Document to JPG in Java
tags: #Java #Visio #Jpg #Diagram
---

Developers can convert any Microsoft Visio document to JPG or JPEG (_Joint Photographic Experts Group_) in Java using [Aspose.Diagram](https://products.aspose.com/diagram) which is a light-weight, extensible, easy to use API and helps developers to create, manipulate and convert Microsoft Visio files to various formats on client side and server-side without any need to install Microsoft Visio or using any sort of Microsoft Office automation.

**Supported Platforms**

>Aspose.Diagram supports both Java and .NET platforms. Please see [Aspose.Diagram for Java](https://products.aspose.com/diagram/java) and [Aspose.Diagram for .NET](https://products.aspose.com/diagram/net) for your reference.

# Sample Microsoft Visio Document - VSDX

For demonstration, we will convert the following [sample Microsoft Visio document](https://github.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/blob/master/Convert-Microsoft-Visio-Document-to-JPG/SampleConvertMicrosoftVisioDocumentToJPEG.vsdx) to JPG or JPEG in Java using Aspose.Diagram for Java. However, you can use any Microsoft Visio document of your choice inside the sample code and it will also be converted to JPEG fine.

![Sample Microsoft Visio Document to be converted to JPG or JPEG using Aspose.Diagram API.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Convert-Microsoft-Visio-Document-to-JPG/Microsoft-Visio-Document-be-converted-JPG-Aspose.Diagram.png "Sample Microsoft Visio Document to be converted to JPG or JPEG using Aspose.Diagram API.")

# Licensing

Please note, if you will execute the code without prior setting the Aspose.Diagram license, you will get _Evaluation Watermark_ in your output documents. For more information, please go through [Licensing](https://docs.aspose.com/display/diagramjava/Licensing).

# Sample Code

The following sample code converts the Microsoft Visio document to JPG or JPEG by performing these steps.

* Load Microsoft Visio document to _com.aspose.diagram.Diagram_ object.
* Specify _ImageSaveOptions_ to set resolution for clear image.
* Save the _com.aspose.diagram.Diagram_ object into JPG format with specified _ImageSaveOptions_.

{% gist https://gist.github.com/AsposeDiagram/d07d333e018e9e5e55daf2856a5f60e5 %}

# Output JPG or JPEG of Microsoft Visio Document by Aspose.Diagram

The following snapshot shows the [Output JPG or JPEG of Microsoft Visio Document generated by Aspose.Diagram](https://github.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/blob/master/Convert-Microsoft-Visio-Document-to-JPG/OutputConvertMicrosoftVisioDocumentToJPEG.jpg) with the code given above. As you can see, the JPG looks exactly same as Microsoft Visio document.

![Output JPG or JPEG generated by Aspose.Diagram from Microsoft Visio document.](https://raw.githubusercontent.com/AsposeDiagram/AsposeDiagram-Screenshots-and-Sample-Files/master/Convert-Microsoft-Visio-Document-to-JPG/OutputConvertMicrosoftVisioDocumentToJPEG.jpg "Output JPG or JPEG generated by Aspose.Diagram from Microsoft Visio document.")