Link to home
Start Free TrialLog in
Avatar of Alex Andrews
Alex Andrews

asked on

Converting a Visio File to .png File

I had this question after viewing Export VSD to JPG using C#.

Hi All,

I have to Convert number of Visio files to .Png Files and I Should Apply the settings to PNG File, reducing the size of the file during the time of Conversion as per the attachment.
Could you Please help me anyone how to do this in C#.Net Automatically?
Avatar of George Walton
George Walton
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi!
It is difficult, because PNG is already well compressed, unlikely to be improved. You can compress it in JPG format.
If it would be helpful, I have macro code that I wrote years ago that saves each page of a Visio diagram as a png image. There are two variations: one that works on every Visio diagram in a directory and one that does that plus all the Visio diagrams in every subdirectory. Let me know whether you'd like either one.
Alex -- do you still need help with your question?
As the internet never sleeps, I'll add this article + code that I wrote many years ago:

Export All Pages in Document
http://www.visguy.com/2006/09/18/export-all-pages-in-document/

This will export an image with the last settings that the user set for image export in the current Visio session. Since the article was written, Visio has added some application settings that let you specify export settings without manually tweaking via the UI.

See the: Visio.Application.Settings.RasterExport___ methods.

Specific to this question:

Visio.Application.Settings.RasterExportDataCompression
Visio.Application.Settings.SetRasterExportResolution


And finally, see this article:
New Visio 2010 API for Configuring Raster Export
https://blogs.msdn.microsoft.com/visio/2010/03/03/new-visio-2010-api-for-configuring-raster-export/
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.