STP Zeichnungen
Contents
[
Hide
]Exportieren im STP-Format nach PDF
Aspose.CAD für Python ermöglicht Entwicklern den Export einer STP Datei im PDF Format. Der Ansatz zur Konvertierung von STP nach PDF funktioniert wie folgt:
- Laden Sie die STP Zeichnungsdatei mit der Image.load Fabrikmethode.
- Erstellen Sie ein Objekt der Klasse CadRasterizationOptions und setzen Sie die Eigenschaften page_height und page_width.
- Erstellen Sie ein Objekt der Klasse PdfOptions und setzen Sie die Eigenschaft vector_rasterization_options.
- Rufen Sie Image.save auf und übergeben Sie ein Objekt der PdfOptions als zweiten Parameter.
Beispielcode
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
import aspose.cad as cad; | |
cadImage = cad.Image.load("file.stp"); | |
rasterizationOptions = cad.imageoptions.CadRasterizationOptions() | |
rasterizationOptions.page_width = 1200 | |
rasterizationOptions.page_height = 1200 | |
pdfOptions = cad.imageoptions.PdfOptions() | |
pdfOptions.vector_rasterization_options = rasterizationOptions | |
cadImage.save("result.pdf", pdfOptions) |