In Development
Last Updated: 19 May 2020 15:15 by ADMIN
Bernd
Created on: 24 Apr 2020 10:54
Category: WordsProcessing
Type: Bug Report
2
WordsProcessing: DocxFormatProvider: Image size values are exported with wrong decimal symbol in specific culture settings
The decimal values are exported using the symbol defined in the thread culture. However, they should always use the period as a decimal symbol. The wrong value can lead to wrong resizing of the image inside the exported document.

Workaround: Change the current culture settings of the thread before exporting:
string cultureName = Thread.CurrentThread.CurrentCulture.Name;
CultureInfo cultureInfo= new CultureInfo(cultureName);
if (cultureInfo.NumberFormat.NumberDecimalSeparator != ".")
{
    cultureInfo.NumberFormat.NumberDecimalSeparator = ".";
    Thread.CurrentThread.CurrentCulture = cultureInfo;
}

0 comments