Skip to content Skip to sidebar Skip to footer

Python Visio To Pdf

I'm trying to convert a bunch of Visio files to pdf in python. I have referenced this .doc to pdf using python and written the following code: import comtypes.client as coms forma

Solution 1:

You should use ExportAsFixedFormat instead SaveAs. Documentation for this function you can find here. This function can be used with a win32 and a comtypes.

win32com example

import win32com.clientvisio= win32com.client.Dispatch("Visio.Application")
doc = visio.Documents.Open('map.vsd')
doc.ExportAsFixedFormat( 1, 'map.pdf', 1, 0 )

comtypes example

import comtypes.client as comsvisio= coms.CreateObject('Visio.Application')
doc = visio.Documents.Open('map.vsd')
doc.ExportAsFixedFormat( 1, 'map.pdf', 1, 0 )

Post a Comment for "Python Visio To Pdf"