Last Updated: 22 Jun 2016 05:53 by ADMIN
Dess | Tech Support Engineer, Principal
Created on: 01 Jun 2016 12:23
Category: RichTextEditor
Type: Bug Report
FIX. RadRichTextEditor - PdfFormatProvider doesn't export the complete Table
To reproduce: please refer to the attached sample project.

Workaround: export RadRichTextEditor's content to a .doc file. Then, use the RadWordsProcessing library to import the .doc file and export it as a pdf:

Telerik.WinForms.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider provider = 
    new Telerik.WinForms.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider();
string fileName = @"..\..\exported.doc";
string pdfFileName = @"..\..\exported.pdf";
Stream s = new FileStream(fileName,FileMode.Create, FileAccess.Write);
provider.Export(document, s);

Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider provider2 = 
    new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
using (Stream input = File.OpenRead(fileName))
    Telerik.Windows.Documents.Flow.Model.RadFlowDocument document2 = provider2.Import(input);
    Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider3 = 
        new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
    using (Stream output = File.OpenWrite(pdfFileName))
        provider3.Export(document2, output);

1 comment
Posted on: 21 Jun 2016 10:47
RadDocument has API of its own, but using it has a set of limitations. First of all, adding and removing Blocks and Inlines from the document can be done only before the document has been measured – a procedure that calculates the desired size of the spans, paragraphs and the document altogether in order to calculate its layout. These operations are usually invoked by the framework when the document in shown in a RadRichTextEditor so we should use DocumentEditor:

The example can be found in the attachments: 1037545 RadRichTextEditor