Infinity loop after executing updatePageLayout

Hi.

We are using the library with license, because we need to retrieve the number of pages and we have an infinity loop after executing the method updatePageLayout with the following specifications.

  • JDK 21
  • Aspose 25.2 - maven tag version jdk17
    After debugging i found that the method with the problem is the following:
final void zzYXw(boolean var1) throws Exception {
    if (this.zzZrx() != this.zzWqr()) {
        zzYw var2;
        while((var2 = (zzYw)this.zzWqr()) != (zzYw)this.zzZrx()) {
            zzWXG var3 = (zzWXG)((zzYw)var2.zzZwl()).zzXz7();
            var2.zzD3(var3, false);
        }
    }
}

Initially we were using the version 23.6, but with that version we got an NullPointerEception and looking for a solution in forums we found that a linked issue with getPageCount will be fix in the release 25.1.

I attach the tested document.
Thanks in advance.
st06012.en25.docx (97.5 KB)

@angarias

It seems you are experiencing an infinite loop issue after executing the UpdatePageLayout method in Aspose.Words. This can occur due to various reasons, especially when dealing with document modifications and layout updates.

The UpdatePageLayout method is designed to format a document into pages and update page number-related fields. It is automatically invoked when you first convert a document to a fixed-page format like PDF or XPS. However, if you modify the document after rendering, you need to call this method manually to ensure the layout is updated correctly.

Given that you are using JDK 21 with Aspose version 25.2, and you previously encountered a NullPointerException in version 23.6, it is possible that the issue you are facing now is related to the specific document you are working with or the way the library interacts with the Java version.

Here are a few suggestions to troubleshoot the infinite loop issue:

  1. Check Document Integrity: Ensure that the document you are processing is not corrupted. You can try opening it in a word processor to verify its integrity.

  2. Update to Latest Version: If possible, consider updating to the latest version of Aspose.Words, as newer versions may contain bug fixes and improvements that could resolve your issue.

  3. Debugging: Since you have already debugged the method, try to isolate the specific conditions that lead to the infinite loop. Look for any modifications to the document that might cause unexpected behavior.

  4. Contact Support: If the issue persists, consider reaching out to Aspose support with detailed information about your environment, the document, and the specific code you are using. They may provide insights or fixes specific to your case.

If you have any further questions or need additional assistance, feel free to ask!

@angarias
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27981

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Regarding the check points:
1.- Already tested and the document is opened without any issue or warning message.
2.- I am using the latest version.
3.- Already done.
4.- I will contact with my PO in order to verify If we could ask for paid support, because we have a license.

@angarias We have already reproduced the problem and logged it as WORDSNET-27981. We will keep you informed and let you know once it is resolved.