Convert IFC to PDF in Java

IFC files are Industry Foundation Classes files that are often used by Building Information Modelling programs. Such programs are helpful for model validation and fast clash detection and IFC files can include information about materials and spatial elements. In certain scenarios, you might need to convert an IFC file to PDF format. This article covers how to convert IFC to PDF in Java programmatically using Aspose.CAD for Java.

CAD API Installation

Aspose.CAD for Java API can be used to work with different CAD file formats as mentioned in the supported file formats section. You can quickly access this PDF creation API by downloading its JAR files from the New Releases page or with the following configurations in the pom.xml file to access the API from Aspose Repository.

Repository:

<repositories>
    <repository>
        <id>AsposeJavaAPI</id>
        <name>Aspose Java API</name>
        <url>http://repository.aspose.com/repo/</url>
    </repository>
</repositories>

Dependency:

 <dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-cad</artifactId>
        <version>22.1</version>        
   </dependency>
</dependencies>

Convert IFC to PDF in Java Programmatically

You can convert an IFC file to a PDF document by following the steps below:

  1. Load the input IFC file.
  2. Instantiate an object of CadRasterizationOptions class.
  3. Initialize an instance of the PdfOptions class.
  4. Finally, write the output file in PDF format.

The following code sample demonstrates how to convert an IFC format file to a PDF file programmatically in Java:

Online IFC to PDF Converter

Online IFC to PDF Converter

Explore More Features

You can take a look at many other features of the PDF creation API by visiting the documentation space.

Conclusion

In this article, you have learned how to convert IFC to PDF in Java programmatically using Aspose.CAD for Java. It merely takes a few API calls to complete the requirements without needing to install any user interface-based application. However, the API supports the IFC2X3 dialect of IFC files at the moment.

Please feel free to write to us at the forum in case of any queries.

Finally, aspose.com is writing new articles. So, please stay in touch for regular updates.

See Also