Disegni STP
Contents
[
Hide
]Esportazione del formato STP in PDF
Aspose.CAD per .NET consente agli sviluppatori di esportare un file STP in formato PDF. L’approccio di conversione da STP a PDF funziona come segue:
- Carica il file di disegno STP 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 della classe 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.stp"; | |
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 STP to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |