This small topic explains how to convert DGN to JPG in Java. It encompasses all the important information like the step wise algorithm and a code snippet to export DGN to JPG image in Java. You will observe different properties to control DGN to JPG during the image rendering process.
Steps to Export DGN to JPG in Java
- Install the Aspose.CAD for Java from the Repository Manager
- Access the source DGN file with an instance of the Image class
- Create an instance of the CadRasterizationOptions class and set its properties
- Instantiate a JpegOptions class object to set the desired JPG options
- Convert the loaded DGN to JPG using the save method
In the aforementioned steps, we have explained the algorithm to convert DGN to JPEG in Java, whereby, we will configure the environment and load the input DGN file. Subsequently, we will set the different properties like image size, scaling, etc. and finally render the image as a JPG file.
Code to Convert DGN to JPG in Java
This example can be used to render DGN to JPG in Java using a few API calls. The CadRasterizationOptions class is used to set customize the rendering of the DGN file by setting properties like automatic layout scaling, layers, margins, quality, etc. The JpegOptions class is used to set the desired output JPG image export options.
In this topic, you have learnt to export a DGN file to JPG in Java. If you are interested in exporting DWG to an SVG image then please refer to the article on how to convert DWG to SVG in Java.