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

HTML in RadEditor Content renders as blank in ExportToPDF

2 Answers 101 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 21 Feb 2013, 08:41 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Feb 2013, 07:52 AM
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.
0
Rumen
Telerik team
answered on 25 Feb 2013, 09:54 AM
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.
Tags
Editor
Asked by
Jay
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Rumen
Telerik team
Share this question
or