Declined
Last Updated: 22 Jun 2016 05:53 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 01 Jun 2016 12:23
Category: RichTextEditor
Type: Bug Report
0
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);
s.Close();
s.Dispose();

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);
    }
}

System.Diagnostics.Process.Start(pdfFileName);       
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
1 comment
ADMIN
Peter
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:

http://docs.telerik.com/devtools/winforms/richtexteditor/features/raddocumenteditor

The example can be found in the attachments: 1037545 RadRichTextEditor Updated.zip