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

RadEditor Export to PDF not obeying CSS

3 Answers 174 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kamal
Top achievements
Rank 1
Kamal asked on 25 Jan 2012, 02:52 PM
Hi

I am trying to export a snippet of code to PDF but the styles aren't being applied. They definitely exist and work since I have generated a standard html page with the exact same html and all the CSS styles are applied. Is there any setting/config/workaround for this? I need the PDF to look exactly like the website.

Thanks

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 Jan 2012, 06:43 PM
Hi,

The third party HTMLtoPDF converter that RadEditor uses to export the HTML content to PDF does not offer support for external css files and it does not render the classes specified in the class attributes of the html elements. It is possible currently to export only inline style attributes.

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
0
Keith Blackman
Top achievements
Rank 1
answered on 07 Jan 2015, 02:45 PM
Any idea why some inline styling won't work?
In my editor i have this html:
<span style="padding-bottom: 150px; font-family: Segoe UI; font-size: 26px;">Here is a heading</span>
<br />
<span style="padding-bottom: 30px; font-family: Segoe UI; font-size: 22px;">This is a subheading</span><br />
<span style="padding-bottom: 20px; font-family: Segoe UI;">This is standard/body text</span>
The Padding-bottom has no effect in either the Design or Preview views of the Editor or (of importance to me), when exported to pdf. The font name and size have been applied but standard "line spacing" has been applied so the 26px and 22px lines overlap. See attached.
I am using Q3 2014 SP1 like this:

<telerik:RadEditor ID="RadEditor1" Runat="server" ContentFilters="PdfExportFilter, DefaultFilters" Language="en-GB" BackColor="White">
<ExportSettings>
        <Pdf PageHeight="297mm" PageWidth="210mm" PaperSize="A4" />
</ExportSettings>
<Content></Content>
<TrackChangesSettings CanAcceptTrackChanges="False"></TrackChangesSettings>
</telerik:RadEditor>



0
Ianko
Telerik team
answered on 09 Jan 2015, 09:11 AM
Hello Keith ,

Firstly, the padding would work only if the span is styled with a display property set to block or inline-block value. Although, exporting to PDF, the display:block is not a valid stylization option.

As for the font-size and family, I am unable to examine any issue with exporting or visualizing the content. I tested with this online demo - Editor - Export to PDF.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Kamal
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Keith Blackman
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or