Unplanned
Last Updated: 16 Apr 2018 12:58 by ADMIN
ADMIN
Polya
Created on: 12 Apr 2018 15:00
Category: RichTextBox
Type: Bug Report
0
RichTextBox: Incorrect default FontSize when importing a document with FontSize omitted on all levels of the style hierarchy
If a document does not have definition for font size in all levels of the font hierarchy, then all runs that do not have font size set locally, will be imported with font size 9.5.
In Microsoft Word, in this case, the font size value is 10.

Workaround: Set the FontSize of the default document style after the document is imported:

RadDocument reportDocument1;
  
using (FileStream inputStream = new FileStream(@"C:\Original.docx", FileMode.Open))
{
    reportDocument1 = provider1.Import(inputStream);
    reportDocument1.StyleRepository[RadDocumentDefaultStyles.DefaultDocumentStyleName].SpanProperties.FontSize = Unit.PointToDip(10);
}
  
using (FileStream output = new FileStream(@"C:\test.docx", FileMode.OpenOrCreate))
{
    provider1.Export(reportDocument1, output);
}

0 comments