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

Export to PDF not working

1 Answer 64 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Shweta malpani
Top achievements
Rank 1
Shweta malpani asked on 13 Jul 2010, 04:04 AM
Hi,

I tried the export to PDF mentioned in this example -
http://www.telerik.com/community/forums/aspnet/editor/error-creating-pdf-with-radeditor.aspx

It works with simple text put out on the Editor but it did not work for me. I get the content from Database where it i stored in rtf and convert to HTML to display in editor. My Content is as shown below and this doesn't get exported to PDF.

"<html>\r\n <head>\r\n <title></title>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\" />\r\n <meta name=\"Generator\" content=\"Microsoft Word 12 (filtered)\" />\r\n <style>\r\n <!--\r\n /* Font Definitions */\r\n @font-face\r\n\t{font-family:\"Cambria Math\";\r\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;}\r\n@font-face\r\n\t{font-family:Calibri;\r\n\tpanose-1:2 15 5 2 2 2 4 3 2 4;}\r\n@font-face\r\n\t{font-family:Verdana;\r\n\tpanose-1:2 11 6 4 3 5 4 4 2 4;}\r\n /* Style Definitions */\r\n p.MsoNormal, li.MsoNormal, div.MsoNormal\r\n\t{margin-top:0in;\r\n\tmargin-right:0in;\r\n\tmargin-bottom:10.0pt;\r\n\tmargin-left:0in;\r\n\tline-height:115%;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Calibri\",\"sans-serif\";}\r\np.msochpdefault, li.msochpdefault, div.msochpdefault\r\n\t{mso-style-name:msochpdefault;\r\n\tmargin-right:0in;\r\n\tmargin-left:0in;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Times New Roman\",\"serif\";}\r\np.msopapdefault, li.msopapdefault, div.msopapdefault\r\n\t{mso-style-name:msopapdefault;\r\n\tmargin-right:0in;\r\n\tmargin-bottom:10.0pt;\r\n\tmargin-left:0in;\r\n\tline-height:115%;\r\n\tfont-size:12.0pt;\r\n\tfont-family:\"Times New Roman\",\"serif\";}\r\n.MsoChpDefault\r\n\t{font-size:10.0pt;}\r\n.MsoPapDefault\r\n\t{margin-bottom:10.0pt;\r\n\tline-height:115%;}\r\n@page WordSection1\r\n\t{size:8.5in 11.0in;\r\n\tmargin:1.0in 1.0in 1.0in 1.0in;}\r\ndiv.WordSection1\r\n\t{page:WordSection1;}\r\n-->\r\n </style>\r\n </head>\r\n <body lang=\"EN-US\" style=\"text-justify-trim: punctuation; overflow: hidden;\">\r\n <div class=\"WordSection1\">\r\n <p class=\"MsoNormal\" style=\"line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: #000000; font-size: 16.5pt;\">THIS PAGE IS NO LONGER UTILIZED.this<span style=\"background: red;\"> is tested</span></span></p>\r\n </div>\r\n </body>\r\n</html>"



Please let me know what I need to do to get the ExportToPDF to work and output a proper PDF file.

thanks
SM

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 14 Jul 2010, 04:17 PM
Hello Shweta,

The third party HTML to PDF converter tool used by RadEditor does not work with full HTML content and only with valid XHTML content. This means that you should load the content inside the body tags and convert the &quot; entities to ' or strip them.

I was able to export the following content:

RadEditor1.Content = "\r\n <div class=\"WordSection1\">\r\n <p class=\"MsoNormal\" style=\"line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: \'verdana\',\'sans-serif\'; color: #000000; font-size: 16.5pt;\">THIS PAGE IS NO LONGER UTILIZED.this<span style=\"background: red;\"> is tested</span></span></p>\r\n </div>\r\n";

Greetings,
Rumen
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Shweta malpani
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or