Hi there,
We are using Aspose.Words for .NET version 20.3 to convert document files to PDF and and one of the steps will update all the form fields inside the document using the line:
doc.UpdateFields();
The entire conversion to PDF code is:
var doc = new Document(input);
doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
doc.AcceptAllRevisions();
doc.UpdateFields();
doc.UpdatePageLayout();
var saveFormat = new PdfSaveOptions
{
OptimizeOutput = true,
ImageCompression = PdfImageCompression.Jpeg,
PreserveFormFields = true,
UpdateFields = true,
SaveFormat = SaveFormat.Pdf
};
doc.Save(output, saveFormat);
We found a document that will get an incorrect Table of Contents that basically is the entire document all over again.
Manually updating the entire ToC in Word will have the expected result.
Here are the input and the output file: toc_issue.zip (148.2 KB)
Thank you!