DRC Drawings
Contents
[
Hide
]Exporting DRC Drawings to PDF
Aspose.CAD provides the feature to load AutoCAD DRC drawing entities and render them as an entire drawing to PDF format. DRC to PDF conversion approach works as follows:
- Load DRC drawing file using the Image.Load factory method.
- Create an object of the CadRasterizationOptions class and set the PageHeight & PageWidth properties.
- Create an object of the PdfOptions class and set the VectorRasterizationOptions property.
- Call Image.Save while passing an object of PdfOptions as the second parameter.
Sample Code
The code sample below shows how to convert a file using default settings.
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); | |
} |