JPEG
JPG
PDF
XML
AI
JPEG
Convert AI to JPEG via Java
Native Java Library to Read, Write & Export AI to JPEG without needing Adobe.
How to Convert AI to JPEG Using Java
In order to render AI to JPEG, we’ll use Aspose.PSD for Java API which is a feature-rich, powerful and easy to use conversion API for Java platform. You can download its latest version directly from Maven and install it within your Maven-based project by adding the following configurations to the pom.xml.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-psd</artifactId>
<version>version of aspose-psd API</version>
<classifier>jdk17</classifier>
</dependency>
Steps to Convert AI to JPEG via Java
Aspose.PSD API makes it easy for the developers to convert AI file to JPEG in just a few lines of code.
- Load input AI image
- Initialize JpegOptions class object
- Specify image properties
- Save output JPEG image
System Requirements
Aspose.PSD for Java supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.PSD for Java directly from Aspose Maven Repository .
Convert AI to JPEG - Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String sourceFile = dataDir + "sourcefile.ai"; | |
String outFile = dataDir + "aitoimage.jpeg"; | |
// Load input AI file | |
AiImage aiimage = (AiImage)Image.load(sourceFileName); | |
// Initialize JpegOptions class instance | |
JpegOptions opts = new JpegOptions(); | |
opts.setQuality(85); | |
// Save output JPEG image | |
image.save(outFile, opts); |