You can find more details at: Convert AI to PSD, PDF, JPEG, or PNG Image Format in Java
Last active
August 8, 2023 09:49
-
-
Save aspose-com-gists/b9ecee55e642a56085a75d2119281959 to your computer and use it in GitHub Desktop.
Convert AI files to PSD, PDF, JPEG or PNG Image Format Programmatically in 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 dataDir = Utils.getDataDir(AIToJPG.class) + "AI/"; | |
String sourceFileName = dataDir + "34992OStroke.ai"; | |
String outFileName = dataDir + "34992OStroke.jpg"; | |
// Load input AI file | |
AiImage image = (AiImage)Image.load(sourceFileName); | |
// Initialize JpegOptions class instance | |
JpegOptions options = new JpegOptions(); | |
options.setQuality(85); | |
// Save output JPEG image | |
image.save(outFileName, options); |
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 sourceFileName = dataDir + "34992OStroke.ai"; | |
String outFileName = dataDir + "34992OStroke.pdf"; | |
// Load input AI image file | |
AiImage image = (AiImage)Image.load(sourceFileName); | |
// Initilize PdfOptions object to specify different options | |
PdfOptions options = new PdfOptions(); | |
// Save output PDF file | |
image.save(outFileName, options); |
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 dataDir = Utils.getDataDir(AIToPNG.class) + "AI/"; | |
String sourceFileName = dataDir + "34992OStroke.ai"; | |
String outFileName = dataDir + "34992OStroke.png"; | |
// Load input AI file | |
AiImage image = (AiImage)Image.load(sourceFileName); | |
// Initilaize PngOptions instance | |
PngOptions options = new PngOptions(); | |
options.setColorType(PngColorType.TruecolorWithAlpha); | |
// Save output PNG image | |
image.save(outFileName, options); |
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 dataDir = Utils.getDataDir(AIToPSD.class) + "AI/"; | |
String sourceFileName = dataDir + "34992OStroke.ai"; | |
String outFileName = dataDir + "34992OStroke.psd"; | |
// Load input image | |
AiImage image = (AiImage)Image.load(sourceFileName); | |
// Initialize PsdOptions class object | |
PsdOptions options = new PsdOptions(); | |
// Save output PSD file | |
image.save(outFileName, options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment