PDF to Image is long height

Document pdfDocument = new Document(“1152.pdf”);

foreach (Page page in pdfDocument.Pages)
{
using (FileStream imageStream = new FileStream(“14612.jpg”, FileMode.Create))
{
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(Convert.ToInt32(page.ArtBox.Width), Convert.ToInt32(page.ArtBox.Height));
Aspose.Pdf.Devices.JpegDevice jpegDeviceLarge = new Aspose.Pdf.Devices.JpegDevice(resolution);
jpegDeviceLarge.RenderingOptions.InterpolationHighQuality = true;
jpegDeviceLarge.RenderingOptions.UseNewImagingEngine = true;
jpegDeviceLarge.Process(page, imageStream);
}
}

1152.pdf (771.4 KB)
14612.jpg (85.9 KB)

It’s a program that converts pdf to jpg, but jpg is actually longer than pdf.

@hbhur102

Could you please share if you are facing similar issue with every PDF file or with a particular one? In case you are facing it with only one file, please share another sample file with which you are obtaining the correct output. We will further proceed to assist you accordingly.

another sample !!!
36.pdf (6.0 MB)
5940001.jpg (169.9 KB)
5950001.jpg (721.1 KB)
5960001.jpg (795.6 KB)
5970001.jpg (201.9 KB)
5980001.jpg (382.8 KB)
5990001.jpg (1.0 MB)
6000001.jpg (673.0 KB)
6010001.jpg (567.1 KB)
6020001.jpg (570.9 KB)
6030001.jpg (297.2 KB)
6040001.jpg (378.1 KB)
6050001.jpg (728.4 KB)
6060001.jpg (848.7 KB)
Uploading: 6070001.jpg… Uploading: 6080001.jpg… Uploading: 6090001.jpg… Uploading: 6100001.jpg… Uploading: 6110001.jpg… Uploading: 6120001.jpg…

@hbhur102

We were able to notice the similar issue in our environment while testing the case with Aspose.PDF for .NET 21.10. Therefore, following tickets have been logged in our issue management system for your both files:

  • PDFNET-50764
  • PDFNET-50765

We will further look into details of the tickets and let you know as soon as they are resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.