DWFx Drawing

DWFx Drawing

DWFx is the newest version of the DWF file format. A DWFx file is a 2D or 3D drawing created with Autodesk CAD software. It is based on the XML Paper Specification (XPS), and hence can be viewed and printed with the Microsoft XPS Viewer.

Aspose.CAD for Java allows developers to open and export DWFx files to PDF format. Following is the code demonstrating how to open DWFx files and save them in PDF format.

// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java
String SourceDir = Utils.getDataDir_DWFXDrawings();
String OutputDir = Utils.getDataDir_Output();
String filePath = SourceDir + "Tyrannosaurus.dwfx";
Image cadImageDwf = Image.load(filePath);
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.setPageWidth(cadImageDwf.getSize().getWidth());
rasterizationOptions.setPageHeight(cadImageDwf.getSize().getHeight());
PdfOptions CADf = new PdfOptions();
CADf.setVectorRasterizationOptions(rasterizationOptions);
cadImageDwf.save(OutputDir + "OpenDwfxFile_out.pdf", CADf);