Hello,
I am working on a project to convert .docx documents to pdf using Aspose.Words library.
When converting a 20Mb docx to pdfon windows OS, the conversion fails due to infinite time taken for document save with the latest version of aspose-words-25.6 and 25.5.
I observed that the conversion was successful within 3 minutes on older version 24.10.
Can you please explain the difference in the behavior of these version?
I also observed conversion failure on AIX for all mentioned versions. Cannot share the document because its contents cannot be disclosed. It’s size is 20Mb and it consists of text and images.
Thanks,
Aakanksha
@aakanksha76
Cause
The issue you’re experiencing with the conversion of large .docx files to PDF using the latest versions of Aspose.Words is likely due to changes in the library that affect performance or memory management. The newer versions may have introduced optimizations or features that do not handle your specific document’s content effectively, resulting in prolonged conversion times or failures.
Solution
To troubleshoot this issue, consider the following steps:
-
Revert to Previous Version: Since the conversion works fine with version 24.10, continue using that version for your project until the issue is resolved in later releases.
-
Check for Updates: Monitor the release notes for Aspose.Words. If there are any bug fixes or performance improvements in newer versions, updating to those may resolve your issue.
-
Optimize Document: Simplify the document by reducing the number of images or complex formatting. This can help identify if specific elements are causing the slowdown.
-
Memory Management: Ensure that your application has sufficient memory allocated, especially when processing large documents. Monitor memory usage during the conversion process.
-
Contact Support: If the issue persists, reach out to Aspose support with details about your document structure (without sharing sensitive content) and the specific behavior you’re encountering.
Code
Here’s a basic example of how to convert a .docx file to PDF using Aspose.Words:
// Load the source Word document
Document doc = new Document("input.docx");
// Save the document as PDF
doc.save("output.pdf");
Next Steps
Implement the suggested solutions and check if they resolve the conversion issue. If problems continue, please provide more details about the document’s structure or any specific error messages you encounter. I look forward to your feedback on whether these steps help!
The conversion fails on AIX OS for all mentioned versions. Can you please try converting a 20Mb docx with text and images to pdf on AIX OS?
@aakanksha76 The infinite loop problem we’ve known about since version 25.2 when converting to PDF will be fixed in version 25.7. However, it’s not guaranteed that this is related to your problem, and unfortunately it’s hard to say more without a document.