RadEditor Export to PDF HTML Encoding/Validation

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

    Posted 17 Jan 2012 Link to this post


    I am trying to export the html content below to PDF format via the RadEditor:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-16"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"><title>INTELLIGENCE SERVICES CONTROL ACT NO. 40 OF 1994</title><link type="text/css" rel="stylesheet" href="/templates/BWCommon.css"><link type="text/css" rel="stylesheet" href="/mylnb/SiteCommon.css"><script type="text/javascript" src="/templates/vendor/jquery-1.6.1.min.js"></script><script type="text/javascript" src="/templates/links.js"></script><script type="text/javascript" src="/templates/popup.js?2"></script><script type="text/javascript" src="/templates/hoverbox.js?2"></script></head><body><p class="Generator-Heading" style="text-align:center">To browse use the Table of Contents on the left or the links provided below.</p><p><br></p><p class="Generator-Heading">Contents</p><p class="Generator-Item" style="margin-left:15pt"><a href="../../../jilc">Legislation - South Africa - National</a></p><p class="Generator-Item" style="margin-left:30pt"><a href="../../kilc">Acts and Regulations</a></p><p class="Generator-Item" style="margin-left:45pt"><a href="../alrg">I</a></p><p class="Generator-Item" style="margin-left:45pt;color:#00267F;margin-top:12pt"><b>  <img style="border:0" width="8" height="9" src="/templates/arrows.gif" alt="">  INTELLIGENCE SERVICES CONTROL ACT NO. 40 OF 1994</b></p><p><br><br></p><p><br><br></p></body></html>

    But this fails with the following exception : 
    Exception Details: System.Xml.XmlException: Invalid XHTML. RadEditor content should be correct XHTML in order to export to PDF.

    What encoding does the XHTML validation use? And can it be set somewhere?


  2. Rumen
    Rumen avatar
    14466 posts

    Posted 17 Jan 2012 Link to this post


    The Export to PDF feature of RadEditor cannot be applied when editing full HTML - thus the content cannot contain <html>, <head>, <body> tags. This is a limitation of the ExportToPdf third party tool that RadEditor uses to export its content to PDF.

    Note that the content that you export from RadEditor should be a valid XHTML (it doesn't matter whether the XHTML standard is Strict or Transitional). If it is not, you will receive an exception that the export cannot be completed: screenshot.

    You can check the markup using the built-in W3C validator dialog of RadEditor or at http://validator.w3.org/check. Make sure that the ConvertToXhtml and PdfExportFilter content filters are enabled, e.g.

    <telerik:RadEditor id="RadEditor1" ContentFilters="DefaultFilters,PdfExportFilter" Runat="server"

    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
Back to Top