Completed
Last Updated: 03 May 2018 06:52 by Dimitar
ADMIN
Hristo
Created on: 02 Mar 2018 10:45
Category: RichTextEditor
Type: Bug Report
0
FIX. RadRichTextEditor - numbers in Cambria font with Regular styles are not exported properly to PDF on Windows 7 and Windows. 8.1
Workaround: 
private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
    if (e.Command is SaveCommand)
    {
        DocumentPosition initial = this.radRichTextEditor1.Document.CaretPosition;
        DocumentPosition start = new DocumentPosition(initial);
        DocumentPosition end = new DocumentPosition(initial);

        var spans = this.radRichTextEditor1.Document.EnumerateChildrenOfType<Span>();
        foreach (var span in spans)
        {
            if (span.FontStyle != FontStyle.Regular)
            {
                continue;
            }

            start.MoveToInline(span);
            end.MoveToEndOfDocumentElement(span);

            this.radRichTextEditor1.Document.Selection.AddSelectionStart(start);
            this.radRichTextEditor1.Document.Selection.AddSelectionEnd(end);

            this.radRichTextEditor1.RichTextBoxElement.Commands.ChangeFontFamilyCommand.Execute("Calibri");
        }

        this.radRichTextEditor1.Document.CaretPosition.MoveToPosition(initial);
    }
}
0 comments