Created
February 18, 2021 14:12
Convert PSB (Photoshop Big) to PDF, JPG, or PSD Programmatically using Java
This file contains hidden or 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
// Specify input path for PSB file | |
String sourceFileName = dataDir + "Simple.psb"; | |
// Load input PSB file | |
PsdLoadOptions options = new PsdLoadOptions(); | |
PsdImage image = (PsdImage)Image.load(sourceFileName, options); | |
// Initialize JpegOptions class object | |
JpegOptions jpgoptions = new JpegOptions(); | |
jpgoptions.setQuality(95); | |
// Convert PSB to JPG file | |
image.save(dataDir + "Simple_output.jpg",jpgoptions); |
This file contains hidden or 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
// Specify path for input PSB file | |
String sourceFileName = dataDir + "Simple.psb"; | |
// Load input PSB file | |
PsdImage image = (PsdImage)Image.load(sourceFileName); | |
// Convert PSB to PDF file | |
image.save(dataDir + "Simple_output.pdf",new PdfOptions()); |
This file contains hidden or 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
// Specify path for input PSB file | |
String sourceFileName = dataDir + "2layers.psb"; | |
// Load input PSB file | |
PsdImage image = (PsdImage)Image.load(sourceFileName); | |
// Initialize PsdOptions class instance | |
PsdOptions options = new PsdOptions(); | |
options.setFileFormatVersion(FileFormatVersion.Psd); | |
// Convert PSB to PSD file | |
image.save(dataDir + "ConvertFromPsb_out.psd",options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment