3DS-Zeichnungen
Contents
[
Hide
]Exportieren des 3DS-Formats als PDF
Aspose.CAD für .NET ermöglicht es Entwicklern, eine 3DS-Datei in das PDF-Format zu exportieren. Der Ansatz zur Konvertierung von 3DS in PDF funktioniert wie folgt:
- Laden Sie die 3DS-Zeichnungsdatei mithilfe der Factory-Methode Image.Load.
- Erstellen Sie ein Objekt der Klasse CadRasterizationOptions und legen Sie die Eigenschaften PageHeight und PageWidth fest.
- Erstellen Sie ein Objekt der Klasse PdfOptions und legen Sie die Eigenschaft VectorRasterizationOptions fest.
- Rufen Sie Image.Save auf und übergeben Sie als zweiten Parameter ein Objekt von PdfOptions.
Beispielcode
This file contains hidden or 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.3ds"; | |
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 3DS to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |