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
Tom
@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();
CurrentThreadSettings.setLocale(Locale.forLanguageTag("pt-BR"));
Document doc = new Document("C:\\Temp\\in.docx");
doc.updateFields();
doc.save("C:\\Temp\\out.docx");
// Restore locale.
CurrentThreadSettings.setLocale(current);
So Aspose.Words behavior is correct and mimics MS Word behaviour.