We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Word to PDF Failed

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);

@stretchdp,

We suggest you please upgrade to the latest version of Aspose.Words for SharePoint i.e. 18.9 and see how it goes on your end?

In case the problem still remains, please ZIP and upload your input Word document (you are getting this problem with) here for testing. We will then investigate the issue on our end and provide you more information.

Thanks for your response! Technically, it’s not the Aspose version that is wrong, since the same binaries work just fine converting the SAME document outside of a timer job (done from PowerShell on the actual production server). The same document works to convert everywhere except on the production servers and only in the timer-job we have that does it based on an event of our own logic. So the SAME document works to convert in almost all conditions, but not in the actual production condition.

@stretchdp,

What version of Aspose.Words for SharePoint are you currently using on server machine?

Please ZIP and upload your input Word document (you are getting this problem with) here for testing. Also, please convert the same document to PDF on your development environment and share it here for our reference. What are the operating systems (OS) installed on your development and server machines? We will then investigate the issue on our end and provide you more information

Windows Server 2012 R2
Aspose.Words.SharePoint 17.1.0 (only DLL references, not the full WSP)

3bd5e776-9177-4264-af4b-a579f05b549a.pdf (93.8 KB)
TEST Extern tillgång.zip (44.4 KB)

Note: The PDF document is actually converted on the production server, the same server that cannot convert it inside a timer job.

@stretchdp,

For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSSP-262. We will further look into the details of this problem and will keep you updated on the status of this issue. We apologize for your inconvenience.