COLLADA-Zeichnungen
Contents
[
Hide
]Exportieren im COLLADA-Format als PDF
Aspose.CAD für .NET ermöglicht Entwicklern, eine Datei im COLLADA-Format in das PDF-Format zu exportieren. Der Konvertierungsansatz von COLLADA nach PDF funktioniert wie folgt:
- Laden Sie die COLLADA-Zeichnungsdatei mithilfe der Methode Image.Load der Fabrik.
- 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 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.dae"; | |
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 COLLADA to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |