Hi Support,
We are Using Spire.Pdf Version 8.11 and we are facing Object reference not set to an instance of an object issue on one of our PDF when converting it to imaged. Here is the code Sample what we are using
using (var doc = new PdfDocument(Server.MapPath("~/pdf/82119a02-b4fe-4444-b382-4e7d6b6bf582.pdf"))) // This is the pdf
{
for (int i = 0; i < doc.Pages.Count; i++)
{
using (Image image = doc.SaveAsImage(i, 192, 192)) //raises error using spire 8.11 - Works fine using other 3rd party tools like 'Aspose'
{
string finalPdfPath = GetCurrentPresentationPdfImagesPath() + "/TestPdf_File" + "_Page" + (i + 1) + ".png";
image.Save(finalPdfPath, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
}
I have also attached the file in which we are facing this issue. Your quick response and fix will be much appreciated.