RadEditor exportToPdf nullReferenceException

2 posts, 0 answers
  1. Corentin
    Corentin avatar
    1 posts
    Member since:
    Oct 2015

    Posted 28 Oct 2015 Link to this post

    Hi, every body,

     

    Today I try to export pdf from one RadEditor ... but the function throw an nullReferenceException.

    Here is my code :

     

    RadEditor radEditor = new RadEditor();
    radEditor.Content = "<div>Hello</div>";
    radEditor.ExportSettings.FileName = "TextFile.pdf";
    radEditor.ExportSettings.OpenInNewWindow = true;
    radEditor.ExportToPdf();
     

    Did I miss something ?

    Thanks,

    Corentin

    RadEditor radEditor = new RadEditor();
    radEditor.Content = "<div>Hello</div>";
    radEditor.ExportSettings.FileName = "TextFile.pdf";
    radEditor.ExportSettings.OpenInNewWindow = true;
    radEditor.ExportToPdf();
    RadEditor radEditor = new RadEditor();
    radEditor.Content = "<div>Hello</div>";
    radEditor.ExportSettings.FileName = "TextFile.pdf";
    radEditor.ExportSettings.OpenInNewWindow = true;
    radEditor.ExportToPdf();
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 29 Oct 2015 Link to this post

    Hi Corentin,

    RadEditor is not designed to be used as a framework or API to export to PDF. You need an actual RadEditor rendered on a page for the exporting to work. 

    What you can use for this case is RadWordsProcessing to convert HTML to RadFlowDocument and next to use a PdfFormatProvider class to export the document to PDF file.

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top