it seems that update of numbered list within IF-field does not work, when document is saved as pdf.
In given example files there are two if fields that contain a text that is formatted as numbered list. Before saving the document all fields will be updated per document.updateFields().
If document is saved as docx everything is fine. Result is shown in ResultOk.jpg.
If document is saved as pdf the text is numbered incorrectly . Result is shown in ResultError.jpg.
Therefore I tested some variants and found the following solution. Using combination of document.updateFields() and document.unlinkFields() seems to solve the problem when saving to pdf.
Question: Is unlinking of fields really necessary or is it a bug?
In the end, I found another example that doesn’t work with the combination of document.updateFields() and document.unlinkFields() either.
If document contains a PAGE or NUMPAGES field in the footer the numbered list is incorrect again.
- “ResultOk.png” (Numbered list ok)
- “ResultError.png” (Numbered list is wrong)
- “TestIfList4Aspose.java” (java file for saving to pdf)
- “Test IfList WithOutPageField.dotx” (Word document with two if fields and nested numbered list)
- “Test IfList WithPageField.dotx” (Word document with two if fields and nested numbered list and page-field in footer)
I am using the latest version of Aspose.Word (19.1)
Thanks a lot
AsposeBug.zip (82.7 KB)