Dessins COLLADA
Contents
[
Hide
]Exportation du format COLLADA vers PDF
Aspose.CAD pour .NET permet aux développeurs d’exporter un fichier COLLADA au format PDF. L’approche de conversion de COLLADA en PDF fonctionne comme suit :
- Chargez le fichier de dessin COLLADA en utilisant la méthode de fabrique Image.Load.
- Créez un objet de la classe CadRasterizationOptions et définissez les propriétés PageHeight et PageWidth.
- Créez un objet de la classe PdfOptions et définissez la propriété VectorRasterizationOptions.
- Appelez Image.Save en passant un objet de PdfOptions comme deuxième paramètre.
Exemple de code
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); | |
} |