Disegni 3DS
Contents
[
Hide
]Esportazione del formato 3DS in PDF
Aspose.CAD per .NET consente agli sviluppatori di esportare un file 3DS in formato PDF. L’approccio di conversione da 3DS a PDF funziona come segue:
- Carica il file di disegno 3DS utilizzando il metodo di fabbrica Image.Load.
- Crea un oggetto della classe CadRasterizationOptions e imposta le proprietà PageHeight e PageWidth.
- Crea un oggetto della classe PdfOptions e imposta la proprietà VectorRasterizationOptions.
- Chiama Image.Save passando un oggetto di PdfOptions come secondo parametro.
Codice di esempio
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.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); | |
} |