DXB Zeichnungen
Contents
[
Hide
]Exportieren des DXB-Formats nach PDF
Aspose.CAD für .NET ermöglicht Entwicklern, eine DXB-Datei in das PDF Format zu exportieren. Der Ansatz zur Konvertierung von DXB in PDF funktioniert wie folgt:
- Laden Sie die DXB-Zeichnungsdatei mit der Image.Load Fabrikmethode.
- Erstellen Sie ein Objekt der CadRasterizationOptions Klasse und setzen Sie die Eigenschaften PageHeight & PageWidth.
- Erstellen Sie ein Objekt der PdfOptions Klasse und setzen Sie die VectorRasterizationOptions Eigenschaft.
- Rufen Sie Image.Save auf, während Sie ein Objekt von PdfOptions als zweiten Parameter übergeben.
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.dxb"; | |
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 DXB to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |