Update TOC Fields & Preserve Font Attributes inside Content Controls during Convert DOCX to PDF Conversion C# .NET

Hi,

When I ran UpdateFields() in Aspose, I noticed a colour change in ToC which does not happen if I ran Ctrl+A then F9 in Word.

Code:
var doc = new Document(@".\test.docx");
doc.UpdateFields();
doc.Save(@"\out.docx");
doc.Save(@"\out.pdf");

You can see in the Aspose docx and pdf output, some of the text became white. While if I updated fields in Word, it remains black.

I’m using the white text in some part of the document because I don’t want them appear in the main document but appear in the ToC, which works fine with MS Word but doesn’t work with Aspose.

test.zip (48.8 KB)
image.png (23.4 KB)

Could you please help me check?

Thanks,

@ServerSide527,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18798. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-18798) have been fixed in this Aspose.Words for .NET 19.9 update and this Aspose.Words for Java 19.9 update.