Convert PDF to JPG (JpegOptions)

Hi Aspose,

I am currently working on a new action called Convert PDF to JPEG using the JpegOptions for configuring the outputted image.

During our testing we have discovered that whenever we set the JpegOptions CompressionType to Lossless or JpegLs that the output file is corrupted regardless of what we set the other JpegOptions to. The Baseline and Progressive compression types work correctly.

Aspose.Imaging.Sources.StreamSource outputStreamSource = new Aspose.Imaging.Sources.StreamSource(memoryStream);
Aspose.Imaging.ImageOptions.JpegOptions options = new Aspose.Imaging.ImageOptions.JpegOptions();

options.Source = outputStreamSource;
options.ResolutionSettings = new Aspose.Imaging.ResolutionSetting(resolution, resolution);
options.ColorType = compressionColourMode;
options.CompressionType = compressionType;
options.ResolutionUnit = resolutionUnit;
options.Quality = imageQuality;

Could you verify that my finding are correct and that there is some kind of bug causing the corrupted file?

Also, as specified in the following screenshot, is the BitsPerChannel property only to be set if we use lossless?

image.png (77.0 KB)

regards,

Djs

@djsomers1000 Thank you for your interest in our product. We appreciate your inquiry and would like to assure you that we are committed to providing you with the best possible support.

After reviewing your request, we would like to kindly inform you that Aspose.Imaging product is designed for creating and manipulating raster and vector images and it provides an option to export an image to the PDF format. However, if you need to load a PDF image and export it to the JPG format, we recommend using Aspose.PDF. I will move your question to the appropriate Aspose.PDF forum section.

We apologize for any confusion this may have caused and hope this information helps.

@djsomers1000

Please try using the code snippet given in the below documentation articles and if you find any issues, please share your sample PDF with us so that we can test the scenario in our environment and address it accordingly.