Hello,
I’m unable to successfully convert some PDF files to images (JPG), some of the converted files images are cut and some imagens in the files completely desapear.
You will be able to reproduce the problem in your online PDF converter to JPG: https://products.aspose.app/pdf/conversion
Can you please very this issue?
I sent to you some example files where this problem happen:
AsposeTest (1).pdf (122.8 KB)
Aspose composed document (1).pdf (310.9 KB)
Thanks
@duvidasAspose
Please check the below code snippet that we used in our environment with 22.11 version of the API and converted your PDFs into JPG images. We did not face any issues. Please try this at your end and let us know if you notice any issues there:
var fs = new FileStream(dataDir + "Aspose composed document (1).pdf", FileMode.Open);
Document pdfDocument = new Document(fs);
foreach (Page page in pdfDocument.Pages)
{
using (FileStream imageStream = new FileStream(dataDir + "Aspose composed document (1)_" + DateTime.Now.Millisecond + ".jpg", FileMode.Create))
{
Resolution resolution = new Resolution(300);
JpegDevice jpegDeviceLarge = new JpegDevice(resolution, 100);
jpegDeviceLarge.RenderingOptions.InterpolationHighQuality = true;
jpegDeviceLarge.RenderingOptions.UseNewImagingEngine = true;
jpegDeviceLarge.Process(page, imageStream);
}
}
fs.Close();
Aspose composed document (1)_464.jpg (298.0 KB)
Aspose composed document (1)_556.jpg (237.0 KB)
Aspose composed document (1)_629.jpg (1.3 MB)
Aspose composed document (1)_571.jpg (780.0 KB)
AsposeTest (1)_552.jpg (289.3 KB)
Thanks, the solution you provided worked.