DWF file is a 2D or 3D drawing saved in Design Web Format. These files are saved as ZIP-compressed files to minimize the size. However, limited applications support opening or viewing such files. In accordance with that, you may like to convert a DWF file to a PDF document for making it compatible with different operating systems and environments. This article covers how to convert DWF to PDF in Java.
DWF to PDF Conversion – Java API Installation
Aspose.CAD for Java API supports working with DWF and other relevant file formats. You can configure the API by downloading the JAR file from the Downloads section, or with the following Maven configurations:
<repositories> <repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>http://repository.aspose.com/repo/</url> </repository> </repositories>
<dependencies> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-cad</artifactId> <version>21.10</version> </dependency> </dependencies>
Convert DWF to PDF Programmatically in Java
The DWF file conversion includes only a few API calls. You can convert a DWG file to a PDF document with the steps below:
- Load the input DWF file.
- Create an instance of CadRasterizationOptions class.
- Set rendering properties like page dimensions for the output file.
- Save the output PDF file with Save method
The following code snippet shows how to convert a DWF file to a PDF document:
Explore More Features
You can learn many other features of the API by taking a look at the documentation. It explains creating, editing, or manipulating different CAD-related file formats.
In this article, you have learned how to convert a DWF file to a PDF file. The conversion can be helpful when you want the file contents to be compatible with different operating systems and environments. Furthermore, please feel free to contact us via the forum. We will be happy to assist you.