PSB to PDF JPG PSD

PSB files can store huge images of large dimensions and large file sizes. You can convert a PSB file to a PDF document, JPEG image, or PSD file programmatically using C#. This article will explain how to convert PSB files to different file formats:

PSB File Converter – C# API Installation

Aspose.PSD for .NET API can be used to create, edit, or manipulate popular image formats. You can install the API by downloading the DLL file from the Downloads section, or with the following NuGet installation command:

PM> Install-Package Aspose.PSD

Convert PSB to PDF File Programmatically using C#

You can convert a PSB file to PDF with the following steps:

  1. Specify the path for input PSB file.
  2. Load input PSB file with the Image class.
  3. Convert PSB to PDF file using PdfOptions class.

The code below shows how to convert PSB to PDF file programmatically using C#:

// Specify path for input PSB file
String sourceFileName = "Simple.psb";
// Load input PSB file
PsdImage image = (PsdImage)Aspose.PSD.Image.Load(sourceFileName);
// Convert PSB to PDF file
image.Save(dataDir + "Simple_output.pdf", new Aspose.PSD.ImageOptions.PdfOptions());

Convert PSB to JPEG Image Programmatically in C#

You can convert a PSB file to a raster image with the API. Please follow the steps below for converting the PSB file to a JPG image:

  1. Specify input path for PSB file.
  2. Load input PSB file with PsdLoadOptions instance.
  3. Initialize JpegOptions class object.
  4. Convert PSB to JPG image file.

The following code explains how to convert a PSB file to JPEG image programmatically with C#:

// Specify input path for PSB file
String sourceFileName = "Simple.psb";
// Load input PSB file
Aspose.PSD.ImageLoadOptions.PsdLoadOptions options = new Aspose.PSD.ImageLoadOptions.PsdLoadOptions();
PsdImage image = (PsdImage)Aspose.PSD.Image.Load(sourceFileName, options);
// Initialize JpegOptions class object
Aspose.PSD.ImageOptions.JpegOptions jpgoptions = new Aspose.PSD.ImageOptions.JpegOptions();
jpgoptions.Quality = 95;
// Convert PSB to JPG image file
image.Save("Simple_output.jpg", jpgoptions);

PSB to PSD File Conversion Programmatically with C#

You can convert a PSB file to PSD with the below steps:

  1. Load input PSB file with the Load method.
  2. Initialize PsdOptions class object.
  3. Convert PSB to PSD file with Save method.

The code below elaborates how to convert a PSB file to PSD programmatically in C#:

// Specify path for input PSB file
String sourceFileName = "2layers.psb";
// Load input PSB file
PsdImage image = (PsdImage)Aspose.PSD.Image.Load(sourceFileName);
// Initialize PsdOptions class instance
Aspose.PSD.ImageOptions.PsdOptions options = new Aspose.PSD.ImageOptions.PsdOptions();
options.FileFormatVersion = FileFormatVersion.Psd;
// Convert PSB to PSD file
image.Save("ConvertFromPsb_out.psd", options);

Get Free API License

You can request a Free Temporary License to test the API in full capacity.

Conclusion

In conclusion, you have learned how to convert a PSB file to PDF, JPEG, or PSD file format programmatically using C#. Simply configure the API in the .NET Framework environment and start converting your files as per your requirements. Moreover, you can further explore the features by visiting the Documentation. Please feel free to contact us at the Free Support Forum for any of your inquiries.

See Also