PS image can't convert to JPEG image

Hi,
When we trying to convert some PS image to JPEG image, the Aspose.Page.EPS.PsDocument.SaveAsImage() API is not returned (this function become unresponsive).

The ASPOSE image conversion failure found for the PS file generated from windows spooler, while taking print from AdobePhotoshop. (attachment : notworking_ps_image.ps)

There is no issue while converting the PS image generated from windows spooler while taking print from applications like Windows Photos, MS Paint etc. (attachment : working_ps_image.ps)

The code we used: (C# application)

            // psFilepath is a valid PS image path
            string tempPath = System.IO.Path.GetDirectoryName(psFilepath);
            // Output path
            string outImage = System.IO.Path.Combine(tempPath, @"AsposeOutput.jpeg");
            // create a stream from input PS image file.
            FileStream IppsStream = new FileStream(psFilepath, FileMode.Open, FileAccess.Read);
            // load the PS file from stream
            PsDocument document = new PsDocument(IppsStream);
            // create an instance of ImageSaveOptions
            Aspose.Page.EPS.Device.ImageSaveOptions options = new Aspose.Page.EPS.Device.ImageSaveOptions();
            //set output image format
            options.ImageFormat = Aspose.Page.Drawing.Imaging.ImageFormat.Jpeg;
            // No error to UI
            options.SupressErrors = true;
            //Set output image quality as maximum
            options.JpegQualityLevel = 100;
            options.SmoothingMode = Aspose.Page.Drawing.Drawing2D.SmoothingMode.HighQuality;
            if (document.ExtractEpsSize().Width > document.ExtractEpsSize().Height)
            {
                // Adjust to print area size
                options.Size = new Aspose.Page.Drawing.Size(1260, 840);
            }
            else
            {
                // Adjust to print area size
                options.Size = new Aspose.Page.Drawing.Size(840, 1260);
            }
            //convert ps file to jpeg and return byte array
            byte[][] imagesBytes = document.SaveAsImage(options);
            // create a stream for output JPEG file
            using (FileStream outStream = File.Open(outImage, FileMode.Create, FileAccess.Write))
            {
                outStream.Write(imagesBytes[0], 0, imagesBytes[0].Length);
            }
            Image image = Image.FromFile(outImage);
            IppsStream.Close();

We attached 2 PS image file
1. working_ps_image.ps
2. notworking_ps_image.ps

could you please check this issue and reply as soon as possible

Thanks
Rejeesh

PS_image_files.zip (7.0 MB)

@rejeeshkp

Would you please share your environment details i.e.

  • OS Name and Version
  • Installed RAM size
  • Application type
  • .NET Version
  • API version

We will further proceed accordingly.

Environment
OS Name and Version Windows 10 - 64 bit
Installed RAM size 16 GB
Application type Desktop application for print an image with a custom printer
.NET Version .Net Framework 4.8
API version Aspose.Page package: 24.3.3 (Verified in latest 24.5.0 also)

@rejeeshkp

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PAGENET-675

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.