Hi
In the process phase to convert a pdf page in png and save it to a stream, I have an untreated exception.
you will find below a part of my code
try
{
using (Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document("RNC_étail.PDF"))
{
// Render the page into a raster image
using (MemoryStream imageStream = new MemoryStream())
{
// Create Resolution object
Resolution res = new Resolution(300);
// Create PNG device with specified attributes
PngDevice pngDevice = new PngDevice(res);
// Convert a particular page and save the image to stream
// The exception occurs here
**pngDevice.Process(pdfDocument.Pages[1], imageStream);**
}
}
}
catch (StackOverflowException EX)
{
Console.WriteLine(EX?.Message);
}
catch (Exception EX)
{
Console.WriteLine(EX?.Message);
}
The problem is that I can not catch the exception.
Thank you in advance.
Exception :
System.StackOverflowException
HResult = 0x800703E9
Message = An exception of type ‘System.StackOverflowException’ was thrown.