cannot convert from RadDocument to RadFixedDocument

3 posts, 0 answers
  1. Pavel
    Pavel avatar
    32 posts
    Member since:
    Sep 2016

    Posted 30 Nov 2016 Link to this post

    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. Dimitar
    Admin
    Dimitar avatar
    2818 posts

    Posted 01 Dec 2016 Link to this post

    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.
  3. Pavel
    Pavel avatar
    32 posts
    Member since:
    Sep 2016

    Posted 01 Dec 2016 in reply to Dimitar Link to this post

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

Back to Top