Blog

visio

Exporting Diagrams from Visio 2013

2014-12-05-exporting-diagrams-from-visio

Exporting Diagrams

Not everybody has a copy of Visio, so there are times when I need to export diagrams from Visio into another format. This may be for viewing online within a webpage; for inclusion in another application, such as PowerPoint; or just for printing. Visio diagrams can hold much more information than just graphics, so it is even possible to export data from a Visio diagram for use in another application.

The following screenshot shows an example BPMN diagram with a Task shape selected so that its Shape Data can be reviewed.

Exporting Visio Graphics

The Save As dialog in Visio presents me with many choices. The top ten options are for the various types and formats of Visio files, and then there are some options that can create multi-page output for use within other applications, such as CAD system, a PDF reader, and XPS document reader or an internet browser. Finally, there are the options that create single image files.

This dialog will present different labels and buttons in the area just below the Authors and Tags labels, depending upon the type of target selected.

Creating Image files

There are two categories of image files, called raster and vector, and each of the image types fall into one of these two.

Raster files are made up of hundreds or thousands of pixels or dots, and are good at displaying photographic images, but are poor at scaling because the number of pixels or dots is fixed at the time of export. These types of files are generally used in web pages, and can be edited by applications such as Microsoft Paint.

Vector images are made up of lines between points defined by mathematical formulas. This means that they are very scalable, but they cannot hold the richness of fill and color variations that can be achieved with raster images.

Exporting a Visio document to a web page actually creates many files, and, even if a vector format, such as VML or SVG, is chosen, then Visio may decide to export parts of the diagram as raster images because the shapes are too complex to display in vector.

The Publishing Options for a web page may include the option of including Visio reports as an HTML table.

Exporting Raster Images

If I choose to export to a raster format like JPG, PNG, GIF, BMP or TIFF, then I will get a chance to transform the image, modify the resolution and size. It is useful to know what the target use will be because it is best to match the settings.

The General options will be different for each image type, and the control of these settings has been improved from earlier versions of Visio.

Exporting vector images

If I choose to export to a vector format like WMF, EMF, SVG, PDF, XPS, DWG or DXF, then I may get a chance to transform the image, modify the resolution and size. It is useful to know what the target use will be because it is best to match the settings.

PDF and XPS files can contain multiple pages, so I will get the opportunity to select any number of pages, the current view, or any selected shapes.

I have tested other PDF creation tools, and I have found that the Microsoft tool does as good a job of creating the output as any. One third party tool claims to include layer and shape data support, but I have found these to be handled inconsistently.

Exporting a page or selected shapes

If I do not have any shapes selected before I start the Save As action, then the whole page is exported to the image file. However, if I select some shape before starting the Save As action, then most of the types will create an image of only the selected shapes.

The resultant image file will only contain these shapes:

The downside is that only complete shapes are exported, so I cannot see the incoming or outgoing arrows in this example.

Exporting Shape Data

Earlier, I observed how the Save as Web Page option can also publish Visio reports from the shape data in the diagram. There are a number of Microsoft provided reports, but I can build my own using the REVIEW / Shape Reports task, and the output can also be to an embedded Excel worksheet within the Visio diagram; to an external Excel workbook; an HTML page; or to an XML file. Creating these reports is beyond the scope of this article, but they are a useful way to extract the data from a Visio diagram. Unfortunately though, they do not contain any information about connections between shapes.

In addition, the Save as Web Page action outputs all of the shape data into a file called data.xml that could be queried using standard web methods, and the SVG export has an option to include the shape data within the markup code. This could be useful for inclusion in web pages too.

Exporting to earlier versions of Visio

I started this article with a list of the export options available, and a number of those are to earlier versions of Visio. Be warned that although the graphics should be displayed satisfactorily, editing of certain features may be disabled because they depend upon code that did not exist in these earlier versions. Therefore, you should consider the implications of round-tripping carefully.

Summary

In this article, I have explained the different types of export options available, and I would choose a different type according to the final use. The ability to export Visio diagrams into a variety of different formats is one of its great strengths, and the graphical quality of shapes has been substantially improved in Visio 2013. Learn more Visio tips and tricks at some of our other pages, such as Creating Custom Shapes or Visio Background Pages and Title Blocks.