FieldPageRef has the wrong page number when saving with Optimize for Word 2019 option

See the attached document. This document was created with ASPOSE.WORDS and saved with CompatibilityOptions.OptimizeFor(Aspose.Words.Settings.MsWordVersion.Word2019);

Notice that paragraphs 1.9 and 1.10 have the page number as being 1-15. If you open the document and update those fields, you’ll see it should be 1-16.

This is reproducible by opening this file and resaving it:

Aspose.Words.Document d = new Aspose.Words.Document(@"C:\temp\KC-130J2021-11-16T18_16_06.docx");                        
            d.CompatibilityOptions.OptimizeFor(Aspose.Words.Settings.MsWordVersion.Word2019); //Page numbers are correct when this line is commented out
            d.UpdatePageLayout();
            d.UpdateFields();
            d.Save(@"C:\\temp\\out2.docx");

Note that when the OptimizeFor is commented out, the page numbers are correct.

KC-130J2021-11-16T18_16_06.docx (62.0 KB)

@cpdog Thank you for reporting this problem to us. I have managed to reproduce it on my side and logged it as WORDSNET-22984 in our defect database. We will keep you informed and let you know once it is resolved.

The issues you have found earlier (filed as WORDSNET-22984) have been fixed in this Aspose.Words for .NET 23.6 update also available on NuGet.