Completed
Last Updated: 24 Nov 2014 11:58 by ADMIN
ADMIN
Georgi I. Georgiev
Created on: 09 Sep 2013 01:29
Category:
Type: Bug Report
1
FIX. RadRichTextBox - Incorrect underlining when exporting to pdf
To reproduce use this code:
Section section1 = new Section();
Paragraph p1 = new Paragraph();
Span s1 = new Span();
s1.UnderlineType = Telerik.WinControls.RichTextBox.UI.UnderlineType.Line;
s1.Text = "Benefit Start";
p1.Inlines.Add(s1);
section1.Blocks.Add(p1);
this.radRichTextBox1.Document.Sections.Add(section1);
Section section = new Section();
var table = new Table();
section.Blocks.Add(table);
TableRow row = new TableRow();
TableCell cell = new TableCell();
Paragraph p = new Paragraph();
Span sp = new Span();
sp.Text = "Benefit Start";
sp.UnderlineType = Telerik.WinControls.RichTextBox.UI.UnderlineType.Line;
p.Inlines.Add(sp);
row.Cells.Add(cell);
cell.Blocks.Add(p);
table.Rows.Add(row);
this.radRichTextBox1.Document.Sections.Add(section);

And this for exporting
private void radButton1_Click(object sender, EventArgs e)
{
    PdfFormatProvider provider = new PdfFormatProvider();
    SaveFileDialog saveDialog = new SaveFileDialog();
    saveDialog.DefaultExt = ".pdf";
    saveDialog.Filter = "PDF|*.pdf";
    DialogResult dialogResult = saveDialog.ShowDialog();
    if (dialogResult == System.Windows.Forms.DialogResult.OK)
    {
        using (Stream output = saveDialog.OpenFile())
        {
            provider.Export(this.radRichTextBox1.Document, output);
            MessageBox.Show("Saved Successfuly!");
        }
    }
}

Open the exported pdf file and you will see that all underlines are too wide

Resolution: 
This issue is addressed in the new version of the control - RadRichTextEditor. Please use the new control instead the RadRichTextBox. 

0 comments