Hi,
I have on premise sharepoint 2016 site with aspose pdf convert functionality.
When I try to convert some word documents to pdf I get this error.
Message: The document appears to be corrupted and cannot be loaded. CallStack:
at x28925c9b27b37a46.x2c8c6741422a1298.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, x1e4394fcb6d34948 x27aceb70372bde46)
at x28925c9b27b37a46.x2c8c6741422a1298.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3, x1e4394fcb6d34948 x27aceb70372bde46)
at x30b8db17afcbbb96.x8a0ce4404d14df27.xb40392da561ede0b(SPFile xb44380e048627945, x707d72c3570dbf2d x5786461d089b10a0, Stream x9c13656d94fc62d0, x80141e1d15343b3f xf2ff58fb9adf566d)
at x30b8db17afcbbb96.x8a0ce4404d14df27.x3cb78ea66d46e377(SPFile xa3b7467a98563b41, xf6792b2e7233729b x5786461d089b10a0, SPFolder x47e34f9055e586c9, SPWeb x84082060b9e9fc88, ConversionOptions xdfde339da46db651, x80141e1d15343b3f xf2ff58fb9adf566d, Boolean xa293a458a0381d5f)
The documents that fail to convert can be converted on my development environment. They only fail within a timer job, the same code and document works if run from a PowerShell script on the server.
Code to convert the word doc to pdf:
var conversionOptions = new ConversionOptions() { DestinationFileName = destinationFileName };
var pdfOptions = new PdfOptions() { Compliance = PdfCompliance.PdfA1b };
var convertedItem = Converter.ConvertFileToPdf(originalFile, destinationFolder, conversionOptions, pdfOptions);