Created
February 18, 2021 14:12
-
-
Save aspose-com-gists/bede9130e2bdc5959ac7d5c860e5a4ff to your computer and use it in GitHub Desktop.
Convert PSB (Photoshop Big) to PDF, JPG, or PSD Programmatically using 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
// 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 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 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