使用Aspose生成基于单词模板的PDF文件时,我遇到语言环境问题。 Aspose会根据系统区域设置(通常是系统中的英语US)格式化数字,但我需要始终将其设置为法语FR。
有没有一种方法可以将Aspose或Word中的语言环境配置设置和“锁定”为法语,而忽略系统语言环境?
预先感谢
使用Aspose生成基于单词模板的PDF文件时,我遇到语言环境问题。 Aspose会根据系统区域设置(通常是系统中的英语US)格式化数字,但我需要始终将其设置为法语FR。
有没有一种方法可以将Aspose或Word中的语言环境配置设置和“锁定”为法语,而忽略系统语言环境?
预先感谢
您可以为线程指定区域性,然后在该线程中运行Aspose.Words转换。
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;
}