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();
var streamBytes = docStream.ToArray();
using (var memoryFilter = new MemoryFilter(0, false))
using (var filterWriter = new FilterWriter(memoryFilter))
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)
PDFNet version 22.214.171.12413
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.