Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active December 23, 2021 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/ca5756248317606c919feedbe045c5b5 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/ca5756248317606c919feedbe045c5b5 to your computer and use it in GitHub Desktop.
Convert IFC to PNG JPG Image Programmatically with Java
// Load input IFC file using the Image class
Image image = Image.load("template.ifc");
// Create an instance of CadRasterizationOptions class
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
// Set the height & width
rasterizationOptions.setPageWidth(1600);
rasterizationOptions.setPageHeight(1600);
// Create an object of JpegOptions
JpegOptions options = new JpegOptions();
// Set the VectorRasterizationOptions
options.setVectorRasterizationOptions(rasterizationOptions);
// Convert IFC to JPG image
image.save("output.jpg", options);
// Load input IFC file using the Image class
Image image = Image.load("template.ifc");
// Create an instance of CadRasterizationOptions class
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
// Set the height & width
rasterizationOptions.setPageWidth(1600);
rasterizationOptions.setPageHeight(1600);
// Create an object of PngOptions
PngOptions options = new PngOptions();
// Set the VectorRasterizationOptions
options.setVectorRasterizationOptions(rasterizationOptions);
// Convert IFC to PNG image
image.save("output.png", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment