Hi guys
I m stuck with an issue where i am trying to apply css to Rad editor control and it is applying the css to the content part.
But when i try to use exporttoPDF() the css is not working on the PDF generated.
This is the sample code :
//For Export to Pdf functionality and applying CSS to Radeditor1
protected void Button1_Click(object sender, EventArgs e)
{
StringWriter sw = new StringWriter();
HtmlTextWriter w = new HtmlTextWriter(sw);
dvPrintSection.RenderControl(w);
string s = sw.GetStringBuilder().ToString();
RadEditor1.CssFiles.Add("Site.css"); // location of my css
RadEditor1.Content = s.Replace(" ", "");
string aa = RadEditor1.CssFiles[0].Value.ToString();
}
//i have used Radeditor like below in aspx
<telerik:RadEditor ID="RadEditor1" runat="server"
ContentFilters="PdfExportFilter, DefaultFilters" Skin="Office2007" >
<ExportSettings Pdf-PageTopMargin="15px" Pdf-PageLeftMargin="20px" Pdf-PageRightMargin="20px"
OpenInNewWindow="true" Pdf-PageHeight="21cm" Pdf-PageWidth="29cm">
<Pdf PageWidth="29cm" PageHeight="21cm" PageTopMargin="15px" PageLeftMargin="20px" PageRightMargin="20px"></Pdf>
</ExportSettings>
<Content>
<table class="test" >
<colgroup></col></colgroup>
<tbody>
<tr>
<td>
TEst data to be printed with class applied
</td>
</tr>
</tbody>
</table>
</Content>
</telerik:RadEditor>
I m stuck with an issue where i am trying to apply css to Rad editor control and it is applying the css to the content part.
But when i try to use exporttoPDF() the css is not working on the PDF generated.
This is the sample code :
//For Export to Pdf functionality and applying CSS to Radeditor1
protected void Button1_Click(object sender, EventArgs e)
{
StringWriter sw = new StringWriter();
HtmlTextWriter w = new HtmlTextWriter(sw);
dvPrintSection.RenderControl(w);
string s = sw.GetStringBuilder().ToString();
RadEditor1.CssFiles.Add("Site.css"); // location of my css
RadEditor1.Content = s.Replace(" ", "");
string aa = RadEditor1.CssFiles[0].Value.ToString();
}
//i have used Radeditor like below in aspx
<telerik:RadEditor ID="RadEditor1" runat="server"
ContentFilters="PdfExportFilter, DefaultFilters" Skin="Office2007" >
<ExportSettings Pdf-PageTopMargin="15px" Pdf-PageLeftMargin="20px" Pdf-PageRightMargin="20px"
OpenInNewWindow="true" Pdf-PageHeight="21cm" Pdf-PageWidth="29cm">
<Pdf PageWidth="29cm" PageHeight="21cm" PageTopMargin="15px" PageLeftMargin="20px" PageRightMargin="20px"></Pdf>
</ExportSettings>
<Content>
<table class="test" >
<colgroup></col></colgroup>
<tbody>
<tr>
<td>
TEst data to be printed with class applied
</td>
</tr>
</tbody>
</table>
</Content>
</telerik:RadEditor>