HTML in RadEditor Content renders as blank in ExportToPDF

3 posts, 0 answers
  1. Jay
    Jay avatar
    59 posts
    Member since:
    Apr 2009

    Posted 21 Feb 2013 Link to this post

    So I've been trying to use the RadEditor to export content to PDF but I've had very mixed results on what HTML can be added.

    I've been reading HTML from another source and then adding it to the content:
    RadEditor.Content = stringOfHTML

    Here's the HTML I've been using for my content:
    <div style="width:700px;">
    <div style="width:100%;"><img src="http://www.cloudprojecthosting.com/1050140/Web/Images/imgDCheaderGraphic.png" width="100%" /></div>
     
     
    <div style="width:49%; float:left;">
       (%NULL:Author Display Name%)<br/>
      (%NULL:Author Company%)<br/>
     (%NULL:Question%)
    </div>
     
    <div style="width:49%; float:right;">
       (%NULL:Answer Display Name%)<br/>
       (%NULL:Answer Company%)<br/>
    (%NULL:Answer%)
    </div>
    </div>

    If I just add this line it renders in the PDF:
    <div style="width:100%;"><img src="http://www.cloudprojecthosting.com/1050140/Web/Images/imgDCheaderGraphic.png" width="100%" /></div>
     But adding any additional lines causes the PDF to open blank?

    I've seen older posts where <Table> can't be used because it needs Colgroup and col or something but that was from 2009? 
    Do I need to add the content as a specific mode or something?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Feb 2013 Link to this post

    Hi Jay

    The PDF converter that RadEditor uses could export only the content inside the BODY tags but not full HTML page content.
    This means that you need to strip the DOCTYPE, <html>, <head> and <body> tags before exporting the content to PDF.

    As a workaround check the following KB article for more information on converting RadEditor HTML to PDF Format
    Converting RadEditor HTML to PDF format

    Thanks
    Shinu.
  3. Rumen
    Admin
    Rumen avatar
    14009 posts

    Posted 25 Feb 2013 Link to this post

    Hello,

    Here are the unsupported scenarios by the export to PDF tool that RadEditor and RadGrid use:
    Image transparency
    • Right-to-left fonts
    • Nested DIV elements with absolute position
    • Nested DIV elements with specified width or height
    • Automatic text clipping
    • Client-side binding
    • Medium trust

    They are listed in the following help article: PDF Export.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top