Working With PSB Files

Converting PSB File to JPEG

Using Aspose.PSD for Java, developers can convert PSB file format to JPEG file format. This topic explains the approach to load the existing PSB file and convert it to a JPEG file format.

String dataDir = Utils.getDataDir(PSBToJPG.class) + "PSB/";
String sourceFileName = dataDir + "Simple.psb";
PsdLoadOptions options = new PsdLoadOptions();
try (PsdImage image = (PsdImage) Image.load(sourceFileName, options)) {
JpegOptions jpgoptions = new JpegOptions();
jpgoptions.setQuality(95);
// All jpeg and psd files must be readable
image.save(dataDir + "Simple_output.jpg", jpgoptions);
image.save(dataDir + "Simple_output.psb");
}

Converting PSB File to PSD

Using Aspose.PSD for Java, developers can convert PSB to PSD file format. This article shows how to export/convert PSB files to PSD format with Aspose.PSD. Aspose.PSD for Java provides the Load method exposed by Image class to load PSB files and the same can be used to save the results. The following code snippet shows you how to convert PSB to PSD file

String dataDir = Utils.getDataDir(PSBToPSD.class) + "PSB/";
String sourceFileName = dataDir + "2layers.psb";
try (PsdImage image = (PsdImage) Image.load(sourceFileName)) {
PsdOptions options = new PsdOptions();
options.setFileFormatVersion(FileFormatVersion.Psd);
image.save(dataDir + "ConvertFromPsb_out.psd", options);
}

Converting PSB File to PDF

Using Aspose.PSD for Java, developers can convert PSB to PDF file format. This article shows how to export/convert PSB files to PDF format with Aspose.PSD. Aspose.PSD for Java provides the Load method exposed by Image class to load PSB files and the same can be used to save the results. The PdfOptions class provides options for creating the PDF such as PageSize, JpegQuality and others. These options can be used to get the desired standard of PDF.

The following code snippet shows you how to convert PSB to PDF file

String dataDir = Utils.getDataDir(PSBToPDF.class) + "PSB/";
String sourceFileName = dataDir + "Simple.psb";
try (PsdImage image = (PsdImage) Image.load(sourceFileName)) {
image.save(dataDir + "Simple_output.pdf", new PdfOptions());
}