This is a migrated thread and some comments may be shown as answers.

cannot convert from RadDocument to RadFixedDocument

2 Answers 595 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 30 Nov 2016, 08:37 PM

I am trying to save the results of mail merge as a PDF, but I am getting a compiler error.

cannot convert from RadDocument to RadFixedDocument

Is there a way around it? Here's my code

using (SaveFileDialog dialog = new SaveFileDialog())
{
    dialog.Filter = "PDF (*.pdf)|*.pdf";
    dialog.FilterIndex = 2;
    dialog.RestoreDirectory = true;
 
    if (dialog.ShowDialog() == DialogResult.OK)
    {
        var provider = new  PdfFormatProvider();
        radRichTextEditor1.Document.MailMergeDataSource.ItemsSource = LetterService.GetEmployersMailMergeSource();
        using (Stream output = File.Create(dialog.FileName))
        {
            //error here
            provider.Export(radRichTextEditor1.Document.MailMerge(), output);
        }
    }
}

 

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 Dec 2016, 09:31 AM
Hi Pavel,

Thank you for writing.

I believe you are using the wrong exporter. Could you please try initializing it like this:
var provider = new Telerik.WinForms.Documents.FormatProviders.Pdf.PdfFormatProvider();

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
0
Pavel
Top achievements
Rank 1
answered on 01 Dec 2016, 02:05 PM

That did it! I am not seeing "accept as answer" button, but thank you very much.

Tags
RichTextEditor
Asked by
Pavel
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Pavel
Top achievements
Rank 1
Share this question
or