Hello!
We have observed that for some documents, executing the method document.GetPageInfo(0)
never finishes. I have attached a sample C# solution that demonstrates the issue.
AsposeInfiniteLoadingBug.7z (54.5 KB)
The sample project is a console application that targets .NET Framework 4.7.2. It has three .docx-files that are used to test the Aspose library’s infinite loading bug.
The files are:
document_that_does_not_load_infinitely.docx
: A document that works fine when calling GetPageInfo(0) on it.
document_that_loads_infinitely.docx
: A document that exhibits the bug when calling GetPageInfo(0).
minimal_document_that_loads_infinitely.docx
: The minimal document I was able to make in order to reproduce the bug.
I noticed a few things when creating the minimal document. The bug seems to only occur when:
- the character ’ is included (in the word “noncompliance’s”)
- the text uses the “Justify” mode (ctrl+J), i.e. each line of text should be stretched out to occupy the entire width of the line.
The bug was originally found in version 25.2.0 of Aspose.Words. I also experimented with upgrading the package to newer versions, which is when I noticed that the bug only occurs in version 25.2.0 for the document “document_that_loads_infinitely.docx”. However, the bug still occurs in versions after 25.2.0-25.6.0 for the document “minimal_document_that_loads_infinitely.docx”. I could not reproduce the bug for any document with version 25.7.0 of Aspose.Words, so perhaps the bug was fixed then?
I searched your forum for similar issues and found these posts:
@lars.olsson
It appears you have encountered a known issue with the GetPageInfo(0)
method in Aspose.Words, particularly with documents that contain specific formatting, such as justified text and certain characters. This issue has been identified in versions 25.2.0 to 25.6.0, but it has been resolved in version 25.7.0 and later.
Cause: The problem arises from specific formatting in the documents that leads to infinite loading when using the GetPageInfo(0)
method.
Solution: To resolve this issue, I recommend the following steps:
-
Upgrade Aspose.Words: Upgrade to version 25.7.0 or later. This should eliminate the infinite loading issue for the affected documents.
-
Test with Different Versions: If upgrading is not feasible, test the documents with various versions of Aspose.Words to confirm the behavior and identify a version that works.
-
Check Document Formatting: For documents that continue to cause issues, modify the formatting (e.g., change justification or remove specific characters) to see if that allows GetPageInfo(0)
to complete successfully.
-
Contact Support: If the problem persists after upgrading, reach out to Aspose support with the specific documents that are causing the issue. Providing them with a sample project will assist them in diagnosing the problem more effectively.
Next Steps: Please proceed with upgrading Aspose.Words to version 25.7.0 or later. If you encounter any further issues, follow the additional steps outlined above.
If you have any further questions or need additional assistance, feel free to ask!
@lars.olsson You are right, the problem is not reproducible with the latest 25.7 version of Aspose.Words. So, I would suggest you to update to the latest version of Aspose.Words.