IFC files are used to model different buildings for construction purposes. In certain situations, you might want to convert an IFC file to a JPG or PNG image to display the model on different operating systems. This article explains how to convert an IFC file to an image programmatically using Java.
- IFC to JPG or PNG Image Converter – Java API Installation
- Convert IFC File to JPG Image Programmatically with Java
- Convert IFC to PNG Image Programmatically using Java
IFC to JPG or PNG Image Converter – Java API Installation
<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.8</version> </dependency> </dependencies>
Convert IFC File to JPG Image Programmatically using Java
You can convert an IFC file to a JPG image with the following steps:
- Firstly, load source IFC file with the Image class constructor.
- Initialize CadRasterizationOptions class object.
- Create an instance of JpegOptions type.
- Convert the IFC to JPG image with VectorRasterizationOptions.
The code snippet below shows how to convert an IFC file to a JPG image using Java:
Convert IFC to PNG Image with Java
You can convert an IFC file to a PNG image with the steps below:
- Load source IFC file with the Image class.
- Initialize an object of CadRasterizationOptions class.
- Instantiate PngOptions class object.
- Finally, convert IFC to PNG image using VectorRasterizationOptions.
The following code sample explains how to convert an IFC file to a PNG image with Java:
Get Free Temporary License
You can request a free temporary license and test the API without any evaluation limitation.
In conclusion, you have explored how to convert an IFC file to an image in JPG or PNG format with Java. Please visit the documentation section to learn the different other features of the API. Moreover, please feel free to write to us at the free support forum in case of any queries.