We are creating a PDF Preview using PDFToImage DLL of PQScan.We need to create preview image of the first page of PDF.
Whenever I try to get the image, it throws System.StackOverflowException. Which can't be catched in try-catch block and it causes the crash for the application.
try
{
using (PQScan.PDFToImage.PDFDocument doc = new PQScan.PDFToImage.PDFDocument())
{
doc.LoadPDF(UTFPDFPath);
doc.DPI = 150;
var temp = doc.PageCount;
using (Bitmap bmp = doc.ToImage(0)) //System.StackOverflowException here
{
bmp.Save(BigPrevName, ImageFormat.Gif);
}
}
}
catch (Exception ex)
{
}
- $exception {"Exception of type 'System.StackOverflowException' was thrown."} System.StackOverflowException