I’m looking for a solution convert .psd files to pdf. Tried with below sample as well but it is throwing an image loading failed exception. I am using Aspose.PSD 23.3.0 version
var filePath = @“C:\Figure1.psd”
using (var psdImage = (Aspose.PSD.FileFormats.Psd.PsdImage)Aspose.PSD.Image.Load(filePath, new Aspose.PSD.ImageLoadOptions.PsdLoadOptions()))
{
psdImage.Save(“Test.pdf”);
}
We find bug that transparency of one layer wasn’t applied correctly in the editable mode, so I created an issue PSDNET-1527: Transparency of layers is not applied when we saving to PDF Format. When the issue will be fixed, you’'ll be notified. Until the fix it’s better to use ReadOnlyMode or remove Layer named “Layer 3” from you input file
@amolm
Please check if your app has the access to save on root folder for drive C. It’s better to try with path like string sourceFile = @“C:\MyTestFolder\Figure1.psd”;
string outputFile = @“C:\MyTestFolder\Figure1.pdf”;
And before the code execution please create MyTestFolder.
Also, please check if the file Figure1.psd is located in the place from where you try to load it.
I have upgraded .net target framework to 6.0, The conversion of .psd to .pdf is working fine on windows environment but we are getting “Image saving failed.” exception on linux.
This can be helpful, please check the packages you need to install on the Linux:
# To use the ability to update the text layers you need to add the following packages to your container
RUN apt-get update
RUN yes | apt-get install -y apt-transport-https
RUN yes | apt-get install -y libgdiplus
RUN yes | apt-get install -y libc6-dev