STP Zeichnungen
Contents
[
Hide
]Exportieren des STP-Formats nach PDF
Aspose.CAD für .NET ermöglicht es Entwicklern, eine STP Datei in das PDF Format zu exportieren. 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 CadRasterizationOptions Klasse und setzen Sie die Eigenschaften PageHeight und PageWidth.
- Erstellen Sie ein Objekt der PdfOptions Klasse und setzen Sie die VectorRasterizationOptions Eigenschaft.
- Rufen Sie Image.Save auf, während Sie ein Objekt von PdfOptions als zweiten Parameter übergeben.
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
string inputFile ="file.stp"; | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize PdfOptions class object | |
PdfOptions options = new PdfOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.PageHeight = 500; | |
cadRasterizationOptions.PageWidth = 500; | |
options.VectorRasterizationOptions = cadRasterizationOptions; | |
// Export STP to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |