Last active
January 22, 2021 02:02
-
-
Save aspose-com-gists/f7837f256dbaeec060de473b43d80bd1 to your computer and use it in GitHub Desktop.
Convert Visio VSD VSDX to PDF using C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Close streams | |
pdfFileStream.Close(); | |
pdfStream.Close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a diagram object to load a VSD/VSDX diagram | |
Diagram diagram = new Diagram("Diagram.vsd"); | |
// Create memory stream and save the diagram as PDF | |
MemoryStream pdfStream = new MemoryStream(); | |
diagram.Save(pdfStream, SaveFileFormat.PDF); | |
// Create a PDF file | |
FileStream pdfFileStream = new FileStream("ExportToPDF.pdf", FileMode.Create, FileAccess.Write); | |
// Write to the file | |
pdfStream.WriteTo(pdfFileStream); | |
// Close streams | |
pdfFileStream.Close(); | |
pdfStream.Close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create memory stream and save the diagram as PDF | |
MemoryStream pdfStream = new MemoryStream(); | |
diagram.Save(pdfStream, SaveFileFormat.PDF); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a diagram object to load a VSD/VSDX diagram | |
Diagram diagram = new Diagram("Diagram.vsd"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a PDF file | |
FileStream pdfFileStream = new FileStream("ExportToPDF.pdf", FileMode.Create, FileAccess.Write); | |
// Write to the file | |
pdfStream.WriteTo(pdfFileStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment