Hi,
I am hitting a stackoverflow exception inside the TryConvert() call when trying to convert a docx file using the following code :
private static PDFDoc GeneratePDF(MemoryStream docStream)
{
var pdfDoc = new PDFDoc();
pdfDoc.InitSecurityHandler();
try
{
docStream.Seek(0, SeekOrigin.Begin);
var streamBytes = docStream.ToArray();
using (var memoryFilter = new MemoryFilter(0, false))
using (var filterWriter = new FilterWriter(memoryFilter))
{
filterWriter.WriteBuffer(streamBytes);
filterWriter.FlushAll();
var conversion = pdftron.PDF.Convert.WordToPDFConversion(pdfDoc, memoryFilter, null);
var result = conversion.TryConvert();
if (result != DocumentConversionResult.e_document_conversion_success)
{
throw new InvalidOperationException(conversion.GetErrorString());
}
}
}
catch (Exception ex)
{
pdfDoc.Dispose();
throw ex;
}
return pdfDoc;
}
PDFNet version 6.8.56.6513
This seems to be true of any docx containing an image.
It only seems to be happening when PDFNet is running on a webserver (IIS)
I put together a Console Project to recreate it and the conversion works without any issues. Same code, same docx, same PDFNet version. It always fails on the webserver.
It's a stackoverflow so I've got very little to go on in the exception itself and obviously I've got no insight into what's happening in the TryConvert() method.
Any ideas?
Thanks,
Andrew