Exception while creating image from pdf file

Hi,
I am trying to create image using pdf but it is throwing an exception - width and height should be greater then zero, but was: -2147483648 x -2147483648 (Parameter ‘bounds’)

Aspose.Pdf.Document docPdf = new Aspose.Pdf.Document(@"C:\chart_1.pdf");
      for (int counter = 1; counter <= docPdf.Pages.Count; counter++)
      {
        var page = docPdf.Pages[counter];
        Aspose.Pdf.Rectangle contextBox = page.CalculateContentBBox();
        page.CropBox = contextBox;
        page.MediaBox = contextBox;

        string imagePath = @"C:\chart_1.jpeg";

        using (FileStream imageStream = new FileStream(imagePath, FileMode.Create))
        {
          Aspose.Pdf.Devices.Resolution jpgResolution = new Aspose.Pdf.Devices.Resolution(300);
          Aspose.Pdf.Devices.JpegDevice jpgDevice = new Aspose.Pdf.Devices.JpegDevice(jpgResolution, 100);
          jpgDevice.Process(page, imageStream);
          imageStream.Close();
        }
      }

chart_1.zip (24.4 KB)

@amolm,

What version of Aspose.Pdf API are you using at the moment?

Aspose.PDF (22.3.0)

@amolm,

Can you try to download the latest API version and see if the same issue happens?

Hi @carlos.molina

I have downloaded latest version 23.4.0, But still same error occured

@carlos.molina Any update on this?

@amolm,

There is definitely an issue with the method CalculateContentBBox. I will be creating a ticket for the dev team with all the information you provided.

@amolm
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): PDFNET-54573

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.

Thank you @carlos.molina

@carlos.molina Any update on this? When this issue will be fixed.

@amolm

The ticket was logged recently in our issue tracking system and it is pending for an initial analysis. It will be investigated and resolved on a first come first serve basis. We will surely inform you once we make some progress towards its resolution. Please spare us some time.

We are sorry for the inconvenience.