Inserting automatic dates in non english language (word) result in english dates in the resulting document (pdf)

french_date.docx (11.8 KB)

I’ve set the above document to a french language, then added an automatic date like in this article.

https://support.microsoft.com/en-us/office/insert-today-s-date-in-a-word-document-fe7c08fe-7192-44a5-ac0a-88ccd51532ab

You process this word document through Aspose, the resulting PDF converts the dynamic date to English. In this case here, opening the word document shows me “mercredi 27 juillet 2022”, the resulting PDF results in “Wednesday 27 July 2022”.

I’d like Aspose to show the french date as inputted in the word document.

@nicolasmartel By default Aspose.Words uses current thread culture to update fields in the document. You can configure Aspose.Words to use culture specified in the field code to get the desired output:

Document doc = new Document("C:\\Temp\\in.docx");
doc.getFieldOptions().setFieldUpdateCultureSource(FieldUpdateCultureSource.FIELD_CODE);
doc.save("C:\\Temp\\out.pdf");

Yep, that was the solution. Thank you.

1 Like