DXF Drawings
Exporting DXF Drawings to PDF
Aspose.CAD provides the feature to load AutoCAD DXF drawing entities and render them as an entire drawing to PDF format. DXF to PDF conversion approach works as follows:
- Load DXF 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.
The code sample below shows how to convert a file using default settings.
Supported Formats
At the moment we fully support AutoCAD DXF 2010 file formats. The previous DXF versions are not guaranteed to be 100% valid. We are planning to include more formats and features in future Aspose.CAD versions.
Supported Entities
At the moment we support all widespread 2D entities and their basic default parameters as follow:
- Aligned Dimension
- Angular Dimension
- Arc
- Attribute
- Block Reference
- Circle
- Diameter Dimension
- Ellipse
- Hatch
- Line
- Multiline Text
- Ordinate Dimension
- Point
- Polyline
- Radial Dimension
- Ray
- Rotated Dimension
- Table
- Text
- Xline
Memory Management
The property ExactReallocateOnly can be used to control memory re-allocation. Re-allocation is most likely to occur for pre-allocated caches. It can happen when the system figures out that the allocated space will not be sufficient.
- If ExactReallocateOnly is set to the default value, False, the space is re-allocated to the same medium.
- When set to True, re-allocation cannot exceed the maximum specified space. In this case, the existing allocated in-memory cache (which requires re-allocation) is freed and extended space is allocated on disk.
Exporting Specific Layer of DXF Drawings to PDF
This approach works as follows:
- Open a DXF drawing file using the Image.load factory method.
- Create an instance of CadRasterizationOptions and specify PageWidth & PageHeight properties.
- Add layers to the object of CadRasterizationOptions.
- Create an instance of PdfOptions & set its VectorRasterizationOptions property.
- Export the drawing to PDF using the Image.save method.
The code sample below shows how to convert a specific layer of DXF to PDF.
Exporting Specific Layer of DXF Drawings to Image
This approach works as follows:
- Open a DXF drawing file using the Image.load factory method.
- Create an instance of CadRasterizationOptions and specify PageWidth & PageHeight properties.
- Add layers to the object of CadRasterizationOptions
- Create an instance of JpegOptions & set its VectorRasterizationOptions property.
- Export the drawing to PDF using the Image.save method.
The code sample below shows how to convert a specific layer of DXF to Image.
Render PDF files as a part of DXF drawings
This approach works as follow:
- Load DXF drawing file using the Image.load factory method.
- Create an object of the CadRasterizationOptions class and load PDF files.
- set the PageHeight & PageWidth properties.
- Call Image.save and save the file.
The code sample below shows how to render PDF files as a part of DXF drawings.
Export DXF to WMF
This approach works as follow:
- Load DXF drawing file using the Image.load factory method.
- Create an object of the CadRasterizationOptions class and load PDF files.
- set the PageHeight & PageWidth properties.
- Call Image.save and save the file.
The code sample below shows how to export DXF to WMF.
Support for Saving DXF Files
Aspose.CAD provides the feature to load AutoCAD DXF files and make changes in it and save it again as a DXF file. The code sample below shows how to achieve specified requirements
Export embedded DGN underlay for DXF format
Aspose.CAD provides the feature to load AutoCAD DXF files and export embedded DGN underlay for DXF format.
The code sample below shows how to achieve specified requirements.
Exporting Specific DXF Layout to PDF
This approach works as follow:
- Open a DXF drawing file using the Image.load factory method.
- Create an instance of CadRasterizationOptions and specify PageWidth & PageHeight properties.
- Specify the desired layout name(s) using the CadRasterizationOptions.Layouts property.
- Create an instance of PdfOptions & set its VectorRasterizationOptionsproperty.
- Export the drawing to PDF using the Image.save method.
The code sample below shows how to convert a specific layout of DXF to PDF.
Access ATTRIB and MTEXT objects
This approach works as follow:
- Open a DXF drawing file using the Image.load factory method.
- Access the entities inside CAD file.
- Check for CadEntityTypeName.MTEXT and CadEntityTypeName.INSERT entities.
- Add to temporary list for further processing
Decompose CAD Insert Objects
This approach works as follow:
- Open a DXF drawing file using the Image.load factory method.
- Access the entities inside CAD file.
- Check for CadEntityTypeName.INSERT entities.
- check for CadBlockEntity type list
- Process the entities
Support of Block Clipping
Aspose.CAD provides the feature of Block Clipping. Block Clipping approach works as follows:
- Load DXF drawing file using the Image.load factory method.
- Create an object of the CadRasterizationOptions class and load PDF files.
- Set desired properties of CadRasterizationOptions.
- Call Image.save while passing an object of PdfOptions as the second parameter and save the file.
The code sample below shows how Block Clipping works.
Export Images to DXF
Using Aspose.CAD, you can export images to the DXF format. Using this approach, you can perform the following actions:
- Set new font
- Hide entities
- Update text
The following code snippet shows you how to perform listed above actions.