Hi,
I am using RadEditor control on my web page. I'm using HTML file as a template to fill in sections of data from database and then display data to user in Editor. I want to allow user to save this data as PDF file but unfortunately, I'm having trouble to save this data to export to PDF file using ExportToPdf() method of RadEditor.
Here is a Code:
code behind:
HTML Template:
In my code, I fill the data from the database for the sections [%=.....%]. While calling method ExportToPdf() I gets this exception:
Invalid XHTML. RadEditor content should be correct XHTML in order to export to PDF. Parse error: Unexpected DTD declaration. Line 674, position 13. at line: <body><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Any help for this ?
Thanks
I am using RadEditor control on my web page. I'm using HTML file as a template to fill in sections of data from database and then display data to user in Editor. I want to allow user to save this data as PDF file but unfortunately, I'm having trouble to save this data to export to PDF file using ExportToPdf() method of RadEditor.
Here is a Code:
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
table
border
=
"0"
cellpadding
=
"0"
cellspacing
=
"0"
width
=
"100%"
>
<
tr
>
<
td
>
<
telerik:RadEditor
ID
=
"fileEditor"
ContentFilters
=
"DefaultFilters,PdfExportFilter"
Height
=
"500"
Width
=
"685"
runat
=
"server"
ToolsFile
=
"~/HtmlEditorTools.xml"
OnExportContent
=
"fileEditor_ExportContent"
>
<
ExportSettings
FileName
=
"abc"
OpenInNewWindow
=
"true"
></
ExportSettings
>
</
telerik:RadEditor
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:Button
ID
=
"btnSavePDF"
runat
=
"server"
Text
=
"Save As PDF"
OnClick
=
"btnSavePDF_Click"
/>
</
td
>
</
tr
>
</
table
>
</
form
>
code behind:
protected void btnSavePDF_Click(object sender, EventArgs e)
{
fileEditor.ExportToPdf();
}
HTML Template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
></
title
>
</
head
>
<
body
>
<
h1
>Product Service Detail</
h1
>
Hi [%=Customer.FirstName%] [%=Customer.LastName%],
<
br
/>
I hope you are fine.
<
br
/>
Please Note Your Product Services:
<
br
/>
[%=ProductServices%]
Thanks,
<
br
/>
Best Regards,
<
br
/>
[%=ProductManager.FullName%]
</
body
>
</
html
>
In my code, I fill the data from the database for the sections [%=.....%]. While calling method ExportToPdf() I gets this exception:
Invalid XHTML. RadEditor content should be correct XHTML in order to export to PDF. Parse error: Unexpected DTD declaration. Line 674, position 13. at line: <body><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Any help for this ?
Thanks