Convert Visio to PDF format
Exporting to PDF
Aspose.Diagram for Python via Java directly writes the information about the API and Version Number in output documents. For example, upon rendering a Drawing to PDF, Aspose.Diagram for Java populates AnwendungFeld mit dem Wert ‘Aspose.Diagram’ undPDF ProducerFeld mit einem Wert, zB ‘Aspose.Diagram 17.9’.
Please note that you cannot instruct Aspose.Diagram for Python via Java to change or remove this information from output Documents.
This article explains how to export a Microsoft Visio diagram to PDF using Aspose.Diagram for Python via Java.
Verwenden Sie den Konstruktor der Diagram-Klasse, um die diagram-Dateien zu lesen, und die Save-Methode, um diagram in ein beliebiges unterstütztes Bildformat zu exportieren.
Die VSD diagram is the example drawing file to export PDF. You can use other diagram formats (VSS, VSSX, VSSM, VDX, VST, VSTX, VSTM, VDX, VTX or VSX) as well.
To export VSD diagram to PDF:
- Erstellen Sie eine Instanz der Klasse Diagram.
- Call the Diagram classs Save method and set the output format to PDF.
Exporting to PDF Programming Sample
import jpype | |
import asposediagram | |
jpype.startJVM() | |
from asposediagram.api import * | |
lic = License() | |
lic.setLicense("Aspose.Total.Product.Family.lic") | |
# Call the diagram constructor to load diagram from a VSD file | |
diagram = Diagram("ExportToPDF.vsd") | |
# Save as PDF file format | |
diagram.save("ExportToPDF_Out.pdf", SaveFileFormat.PDF) | |
jpype.shutdownJVM() |
Mehrere Seiten aufteilen
Aspose.Diagram for Java allows splitting multiple pages while converting the Microsoft Visio Diagram to PDF. The following code snippet shows the functionality.
import jpype | |
import asposediagram | |
jpype.startJVM() | |
from asposediagram.api import * | |
lic = License() | |
lic.setLicense("Aspose.Total.Product.Family.lic") | |
# Call the diagram constructor to load diagram from a VSDX file | |
diagram = Diagram("Network Diagram_start.vsdx") | |
# Options when saving a diagram into the PDF format | |
options = PdfSaveOptions() | |
# set SplitMultiPages option | |
options.setSplitMultiPages(True) | |
# save in PDF format | |
diagram.save("SplitMultiPages.pdf", options) | |
jpype.shutdownJVM() |