Controlling table widths when Exporting PDF

4 posts, 1 answers
  1. DTech
    DTech avatar
    17 posts
    Member since:
    Aug 2009

    Posted 18 Jan 2011 Link to this post

    I need control of the table columns widths when exporting to PDF from the RadEditor.   I followed instructions from (on exporting HTML to PDF).  I followed the instructions under 'Exporting HTML Tables' to test controlling table widths.  I copied and pasted the following into my RadEditor and exported the PDF and it does not work.  I suspect that it may not be working because of the automatic corrections that RadEditor makes (I disabled 2 filters but it did not correct it). 

    1) How do I disable this auto correction?
    2) Is the html table below correct for controlling column widths in PDFs?

    Please see source:

    ASPX Page:
    <%@ Page Language="VB" %>
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <script runat="server">
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        End Sub
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            If IsPostBack = False Then
            End If
        End Sub
    <head runat="server">
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
          <telerik:RadEditor ID="RadEditor1" Runat="server"
            ContentFilters="DefaultFilters,PdfExportFilter"><ExportSettings Pdf-PageBottomMargin="10px" Pdf-PageFooterMargin="0px" Pdf-PageHeaderMargin="0px"
                Pdf-PageLeftMargin="10px" Pdf-PageRightMargin="10px"
                Pdf-PageTopMargin="10px" OpenInNewWindow="true" >
                <Pdf PageTopMargin="10px" PageBottomMargin="10px" PageLeftMargin="10px" PageRightMargin="10px" PageHeaderMargin="0px" PageFooterMargin="0px"></Pdf></ExportSettings><Tools><telerik:EditorToolGroup></telerik:EditorToolGroup></Tools><Content>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

    Table example that I pasted directly off of help link:
    <table width="300px">
           <col style="200px" />
           <col style="20px" />

    After I paste the above HTML in the HTML section of the RadEditor, I clicked back to Design, then back to HTML and it changes the code to this:
    <table style="width: 0px;" width="300px">
           <col style="">
           <col style="">

  2. Answer
    Rumen avatar
    14459 posts

    Posted 20 Jan 2011 Link to this post

    Hello DTech,

    The reported problem is fixed in the latest Q3 2010 SP2 release (version 2010.3.1317) of RadControls for ASP.NET AJAX. You can test the Export to PDF demo to verify that the problem is fixed.

    All the best,
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Lucas
    Lucas avatar
    11 posts
    Member since:
    Apr 2008

    Posted 18 Nov 2011 Link to this post

    I am having a similar issue, and we are using the latest RadEditor with DotNetNuke. Anytime we make a table, RadEditor defined a style="width: 0px" attribute. That messes up the formatting it most browsers. This happens even if there's an existing table that we simply save.
  4. Rumen
    Rumen avatar
    14459 posts

    Posted 22 Nov 2011 Link to this post

    Hi Lucas,

    If you do not export the content to PDF, you should disable the PdfExportFilter content filter which applies  style="width:0;" to the table elements. It is a requirement that the tables has some width so that they can be exported to PDF.

    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