With the footnote in this document, table of contents page numbers and update field values are incorrect.
Attached are input and result files for below code; there is a footnote on page 4. The generated file does not have correct page numbers; when the footnote is removed, numbering is correct.
- Code: Select all
Document doc = new Document();
doc.LoadFromStream(File.OpenRead("TestFail.docx"),FileFormat.Docx);
doc.GetText();
doc.UpdateTableOfContents();
doc.IsUpdateFields = true;
doc.SaveToFile("ResultFail.docx",FileFormat.Docx);