Hide header/footer when exporting to PDF?

5 posts, 1 answers
  1. Frank
    Frank avatar
    7 posts
    Member since:
    Nov 2011

    Posted 19 Nov 2014 Link to this post

    Is there any way that you can exclude the toolbars with the export buttons and the message about dragging columns to group, and footer/pager from the PDF when exporting the grid? See the attached PDF screen shot for an example.

    Frank Wanicka
  2. Answer
    Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 20 Nov 2014 Link to this post

    Hi,

    Not currently, but I just pushed a small new feature that should help.  It will be available in the next internal build.

    During PDF export, the toplevel DOM element will get the CSS class "k-pdf-export", and thus you can use plain CSS to exclude elements of your choice.  For example to exclude the grid toolbar and group header you would add this CSS to your page:

          .k-pdf-export .k-grid-toolbar,
          .k-pdf-export .k-grouping-header {
            display: none;
          }

    You can use the DOM Inspector to figure out the classes of the elements that you want to exclude.

    Again, you will be able to use this feature after downloading the next internal build.  We normally release builds on Fridays.

    Regards,
    Mihai
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Frank
    Frank avatar
    7 posts
    Member since:
    Nov 2011

    Posted 20 Nov 2014 in reply to Mihai Link to this post

    Excellent. Thanks very much.
  4. William
    William avatar
    2 posts
    Member since:
    Oct 2015

    Posted 27 Feb 2016 in reply to Mihai Link to this post

    That works great but I can't seem to get the footer to go away. Here is what I have:

     

    <style>
        .k-pdf-export .k-grid-toolbar, .k-pdf-export .k-grid-footer,
          .k-pdf-export .k-grouping-header {
            display: none;
          }
    </style>
  5. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 29 Feb 2016 Link to this post

    Hi,

    Use .k-pdf-export .k-grid-pager to target the footer element in PDF.

    Regards,
    Mihai
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top