RadEditor Export to PDF not obeying CSS

4 posts, 0 answers
  1. Kamal
    Kamal avatar
    3 posts
    Member since:
    Dec 2011

    Posted 25 Jan 2012 Link to this post


    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.

  2. Rumen
    Rumen avatar
    14459 posts

    Posted 25 Jan 2012 Link to this post


    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,
    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
  3. Keith Blackman
    Keith Blackman avatar
    5 posts
    Member since:
    Dec 2009

    Posted 07 Jan 2015 in reply to Rumen Link to this post

    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">
            <Pdf PageHeight="297mm" PageWidth="210mm" PaperSize="A4" />
    <TrackChangesSettings CanAcceptTrackChanges="False"></TrackChangesSettings>

  4. Ianko
    Ianko avatar
    1956 posts

    Posted 09 Jan 2015 Link to this post

    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.


    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.

Back to Top