We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

TOC empty in case of brasilian fonts in header

Dear aspose team,
we’re faced with an issue while using apose words with word documents based on portuguese fonts / encoding.
The headings are based on
Titulo Azul, Titulo Cinza, …
which means Heading 1, Heading 2, …

TOC in Word document is fine before doing updateFields().
After calling updateFields the TOC is empty. No references found!

If I change manually the headers to Heading 1, Heading 2, … the TOC is fine for that certain headers.

Any idea about that issue?

Thanks in advance

@gustavder3 Could you please attach your input and output documents here for testing? We will check the issue and provide you more information. Most likely, Aspose.Words does not understand the localized Portuguese heading style names.

Hi Alexey,
attached you’ll find an test document without customer internal contents.

Cheers Tom

Test Document Brazil - V2.docx (56.0 KB)

@gustavder3 MS Word also cannot update TOC in your document on my side. However, if specify Brazil culture of the thread the TOC is updated properly:

// Set locale for the current thread.
Locale current = CurrentThreadSettings.getLocale();

Document doc = new Document("C:\\Temp\\in.docx");

// Restore locale.

So Aspose.Words behavior is correct and mimics MS Word behaviour.