Skip to end of metadata
Go to start of metadata
  

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:

  1. Load DXF drawing file using the Image.Load factory method.
  2. Create an object of the CadRasterizationOptions class and set the PageHeight & PageWidth properties.
  3. Create an object of the PdfOptions class and set the VectorRasterizationOptions property.
  4. 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:

  1. Aligned Dimension
  2. Angular Dimension
  3. Arc
  4. Attribute
  5. Block Reference
  6. Circle
  7. Diameter Dimension
  8. Ellipse
  9. Hatch
  10. Line
  11. Multiline Text
  12. Ordinate Dimension
  13. Point
  14. Polyline
  15. Radial Dimension
  16. Ray
  17. Rotated Dimension
  18. Table
  19. Text
  20. Xline

If during parsing we encounter some entity or property we do not support the entity or property will be silently ignored.

Memory Management

The property ExactReallocateOnly of the Cache class 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:

  1. Open a DXF drawing file using the Image.Load factory method.
  2. Create an instance of CadRasterizationOptions and specify PageWidth & PageHeight properties.
  3. Add layers to the object of CadRasterizationOptions.
  4. Create an instance of PdfOptions & set its VectorRasterizationOptions property.
  5. Call the Image.Save method and pass the object of PdfOptions as the second parameter.

The code sample below shows how to convert a specific layer of DXF to PDF.

Render PDF files as a part of DXF drawings

This approach works as follow:

  1. Load DXF drawing file using the Image.Load factory method.
  2. Create an object of the CadRasterizationOptions class and load PDF files.
  3. set the PageHeight & PageWidth properties.
  4. Call Image.Save and save the file.

The code sample below shows how to render PDF files as a part of DXF drawings.

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.

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 DXF to WMF

This approach works as follow:

  1. Load DXF drawing file using the Image.Load factory method.
  2. Create an object of the CadRasterizationOptions class and load PDF files.
  3. set the PageHeight & PageWidth properties.
  4. Call Image.Save and save file.

Exporting Specific DXF Layout to PDF

This approach works as follow:

  1. Open a DXF drawing file using the Image.Load factory method.
  2. Create an instance of CadRasterizationOptions and specify PageWidth & PageHeight properties.
  3. Specify the desired layout name(s) using the CadRasterizationOptions.Layouts property.
  4. Create an instance of PdfOptions & set its VectorRasterizationOptions property.
  5. Export the drawing to PDF calling the Image.Save method and passing the object of PdfOptions as the second parameter.
    .

The code sample below shows how to convert a specific layout of DXF to PDF.

The property CadRasterizationOptions.Layouts is of type string array so you may specify more than one layouts at a time for possible conversion to PDF format. While specifying multiple layouts for the CadRasterizationOptions.Layouts property, the resultant PDF would have multiple pages, where each page represents an individual AutoCAD layout.

Support of Block Clipping

Aspose.CAD provides the feature of Block Clipping. Block Clipping approach works as follows:

  1. Load DXF drawing file using the Image.Load factory method.
  2. Create an object of the CadRasterizationOptions class and load PDF files.
  3. Set desired properties of CadRasterizationOptions.
  4. Call Image.Save while passing an object of PdfOptions as 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 DXF format. Using this approach, you can perform the following actions:

  1. Set new font
  2. Hide entities
  3. Update text

The following code snippet shows you how to perform listed above actions.

Exporting Specific Layer of DXF Drawings to Image

This approach works as follows:

  1. Open a DXF drawing file using the Image.Load factory method.
  2. Create an instance of CadRasterizationOptions and specify PageWidth and PageHeight properties.
  3. Add layers to the object of CadRasterizationOptions.
  4. Create an instance of JpegOptions and set its VectorRasterizationOptions property.
  5. 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.

Labels
  • No labels