简体   繁体   中英

How to Set Locale for Aspose.word

I'm having locale issues while using Aspose to generate PDF files based on a word template. Aspose is formatting the numbers based on the system locale (usually English US on our system), but I need it to always be formatted in French FR.

Is there a way to set and "lock" the locale configuration in either Aspose or Word to French and ignore the system locale?

Thanks in advance

You can specify culture for a thread and run Aspose.Words conversion in this thread.

CultureInfo culture = Thread.CurrentThread.CurrentCulture;
// Change current culture.
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
try
{
    // Generate your document here.
}
finally
{
    // Restore culture.
    Thread.CurrentThread.CurrentCulture = culture;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM