Convert AI image to PSD PDF PNG JPEG Java

Adobe Illustrator files can be used to transform ideas into reality. However, this file format is not widely supported by many applications. So you might need to convert AI files to different raster images and other file formats. You can easily and quickly convert the AI files to PSD, PNG, JPEG, or a PDF file in your Java applications. Let us go through the following topics to understand it better:

AI to Images or PDF Converter – API Installation

Aspose.PSD for Java API supports converting the Adobe Illustrator (AI) files to raster images as well as PDF format. You only need to make simple API calls and the output files will be saved as per your requirements. You can configure the API in a couple of minutes either by downloading its JAR file from the New Releases section, or setting it up in the POM.xml file of your Maven-based project, as under:

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-psd</artifactId>
        <version>20.8</version>
        <classifier>jdk16</classifier>
   </dependency>
</dependencies>

Convert AI to PSD File in Java

Let us start with one of the famous use cases where you can convert AI files to PSD files in your Java applications. Here you will be learning about AI to PSD format conversion. You need to follow the steps below for AI to PSD conversion:

  1. Load the input AI image using AiImage class
  2. Initialize PsdOptions object
  3. Save output PSD file

The following code shows how to convert AI file to a PSD file using Java language with these steps:

Convert AI to PDF File in Java

PDF file format is one of the widely supported file format and you can easily convert AI files to PDF in Java with the following steps:

  1. Load input AI file
  2. Initialize PdfOptions class object
  3. Save output PDF file

The code snippet below shows how to convert AI to PDF files in Java:

Converting AI to JPEG Image in Java

JPEG images are frequently used for displaying visual information. You can convert AI image to JPEG image in Java with the steps below:

  1. Load input AI image
  2. Initialize JpegOptions class object
  3. Specify image properties
  4. Save output JPEG image

The code below elaborates how to convert AI images to JPEG using Java language:

Convert AI to PNG Image in Java

Moving another step further, PNG images can store a lot of information including transparency of contents. You can convert AI files to PNG format by following these steps:

  1. Load input AI image
  2. Initialize PngOptions class object
  3. Save output PNG image

The following code explains how to convert AI image to PNG file in Java language programmatically:

Conclusion

In this article, we have learned how to convert Adobe Illustrator (AI) files to different popular file formats including PSD, PDF, JPEG, PNG, etc. You do not need to install any third-party application to convert these file formats as the API is self-sufficient. It is not dependent on other services so you can easily enable your Java application with these AI files conversion features. Furthermore, if you want to discuss your requirements, please get in touch with us via the Free Support Forum.

See Also