Convert Visio VSD/VSDX File to Image Programmatically in C#

visio to image

Microsoft Visio drawings are frequently used in organizations for different design purposes. You can convert a Visio Diagram file to an image format programmatically using C#. This conversion is helpful because images can be shared and previewed easily as compared to the drawing formats VSD, VSDX, etc. This article covers different conversion scenarios under the following sections:

Visio Drawing to Image Converter – C# API Installation

Aspose.Diagram for .NET API can be used to work with diagram files. You can create, edit, or manipulate VSD, VSDX, and several other file formats programmatically using C# language in .NET Framework. Please configure the API by downloading it from the Downloads section, or with the following NuGet installation command:

PM> Install-Package Aspose.Diagram

Convert Visio (VSD/VSDX) File to Image Programmatically using C#

You may need to convert a Visio drawing to a JPG, PNG, TIFF, or other image formats with the following steps:

  1. Call the diagram constructor to load the input VSD/VSDX drawing.
  2. Save output JPG, SVG, BMP, GIF, or SVG Image file.

The below code shows how to convert a VSD/VSDX diagram to a JPG, SVG, BMP, GIF, or SVG image programmatically using C#:

Convert a Specific Page of Visio VSD/VSDX to Image using C#

Sometimes you may want to refer to a specific page in a Visio drawing and see its content or create a thumbnail. You can easily convert a specific page of a VSD/VSDX file to an image file. Please follow the steps below for rendering a specific page of a Visio diagram file to an image programmatically using C#:

  1. Load input diagram as VSD/VSDX file with the Diagram class.
  2. Specify output image format such as PNG.
  3. Specify the page with page index.
  4. Save output Image formats like JPG, SVG, BMP, GIF, or SVG files with Save method.

The following code explains how to convert a specific page in a Visio diagram file (VSD/VSDX) to an image programmatically using C#:

Get Free API License

You may request a Free Temporary License to evaluate the API without any limitations.

Conclusion

In conclusion, you have learned how to convert a Visio diagram file to an image format, as well as how to convert a specific page in VSD/VSDX file to an image programmatically using C#. Moreover, you may also take a look at the API Documentation for more information about the API. In case of any queries, please feel free to get in touch with us over the Free Support Forum.

See Also

Convert MS Visio Diagrams to PDF using C#