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();
}
}
@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.
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.