When I try to convert the attached pdf to tiff images, it fails with stackoverflow exception. It is quite bad since StackOverflowException cannot be caught and it kills the whole process
var pdfDocument = new Document(Path.Combine(inputDir, inputFile));
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
var jpegFilename = Path.Combine(outputDir, “Image” + pageCount + “.jpg”);
using (var imageStream = new FileStream(jpegFilename, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))
{
var memoryStream = new MemoryStream();
var resolution = new Resolution(600);
var jpegDevice = new TiffDevice(resolution);
//convert a particular page and save the image to stream
jpegDevice.Process(pdfDocument, pageCount, pageCount, memoryStream);
}
}