Disegni DRC
Contents
[
Hide
]Esportazione dei Disegni DRC in PDF
Aspose.CAD offre la funzionalità di caricare entità di disegno AutoCAD DRC e renderizzarle come un intero disegno in formato PDF. L’approccio alla conversione da DRC a PDF funziona come segue:
- Carica il file di disegno DRC utilizzando il metodo factory 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
Il campione di codice sottostante mostra come convertire un file utilizzando le impostazioni predefinite.
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.drc"; | |
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 DRC to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |