Convert the first shape of the first page in a Visio file to PDF file. The converted PDF file will be placed in the same directory of the Visio file.
pip install visio2pdf
from visio2pdf import Visio2PDFConverter
vpc = Visio2PDFConverter(visio_process_name = 'visio.exe',
current_working_directory = None,
temp_file_name = 'visio2pdf4latex_temp', visio_ext_names = ['vsdx', 'vsd'])
vpc.convert('one_visio_file.vsd')
The process name of Microsoft visio, default = visio.exe
. This attribute is used for identifying existing visio process.
The current working directory, default = None
. This attribute is used for converting all visio files in the current working directory if no attribute is provided to the convert
method. Two examples are shown in Convert all visio files in a folder and Convert all visio files in the current folder.
If current_working_directory
is None
, the converter will use the directory determined by the __file__
attribute provide by the invoking script as current working directory.
If current_working_directory
is a path, the converter will use the provided path as current working directory.
The temporal file name, defalut = visio2pdf4latex_temp
. During conversion, two temporal files will be created, one .svg
file and one .vsdx
file. If temp_file_name
is set to WT_
, the temporal files will be WT_.svg
and WT_.vsdx
.
The extension name of the visio files, default = ['vsdx', 'vsd']
. The converter only converts the files with these extension names.
This will convert the visio file one_visio_file.vsd
.
vpc = Visio2PDFConverter()
vpc.convert('one_visio_file.vsd')
This will convert the visio files with a specified name, either .vsd
or .vsdx
.
Both one_visio_file.vsd
and one_visio_file.vsdx
will be converted to PDF file.
vpc = Visio2PDFConverter()
vpc.convert('one_visio_file')
This will convert all visio files in visio_file_folder_path
and all the sub-directories.
The visio_file_folder_path
can be provided to the convert
method.
Or to the current_working_directory
when creating the Visio2PDFConverter
.
vpc = Visio2PDFConverter()
vpc.convert('visio_file_folder_path')
or
vpc = Visio2PDFConverter(current_working_directory = 'visio_file_folder_path')
vpc.convert()
This will convert all visio files in the current folder (determined by __file__
) and all the sub-directories.
vpc = Visio2PDFConverter()
vpc.convert()
By default, the created converter will convert all visio files (.vsd
and .vsdx
). The extension name can be specified by using visio_ext_names
(default value: ['vsdx', 'vsd']
).
vpc = Visio2PDFConverter(visio_ext_names = ['vsdx'])
vpc.convert('one_visio_file.vsdx')
visio2pdf's People
Forkers
julianhu1979Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.