How to Convert CDR to PSD in Java

Here is a brief tutorial that will guide you on how to convert CDR to PSD in Java. You will have complete control to convert CDR file to PSD format in Java by setting a number of parameters including the layers configuration, rasterization options, and smoothing mode. You can perform this operation in any of the common operating systems like MS Windows, macOS, and Ubuntu.

Steps to Convert CDR to PSD in Java

  1. Add Aspose.Imaging from the Maven Repository into the project for CDR to PSD conversion
  2. Using the CdrImage object, load the source CDR file
  3. Instantiate the PsdOptions object to set parameters of the output PSD file
  4. Set options to render all the pages in the source CDR file
  5. Using the merger layer option, configure to create a single layer in the output file
  6. Set vector rasterization option by setting color as white and height and width equivalent to the source image
  7. Set smoothing mode to None
  8. Save the output PSD file on disc using the PsdOptions configured above

While converting the CDR file to PSD in Java we simply load the source CDR file and then instantiate PsdOptions to set a few parameters of the output PSD file. You can set layer configuration, like we set a single layer in the output PSD file rather than rendering each source file page as a separate page in the PSD file. The rasterization options are also set along with the smoothing mode.

Code to Change CDR file to PSD in Java

In this code, we have written a CDR file to PSD converter in Java such that Image.load() function is used to load the source CDR file into CdrImage object. In the next step, we initialize the ImageOptionsBase object with the PsdOptions class object to set MultiPageOptions, MergeLayers property and VectorRasterizationOptions with white color and source image size. SmoothingMode is set to None in the output file.

If you want to learn other types of conversion, have a look at the article on how to convert Bitmap to PNG in Java. This tutorial does not require any other third-party tool installation to perform this conversion.

 English