New to Kendo UI for jQueryStart a free 30-day trial

PDF Export

Updated on Jul 17, 2026

The TreeList provides built-in PDF export for hierarchical data. Add the PDF command to the toolbar to let users download TreeList data as a PDF document.

For a runnable example, refer to the TreeList PDF export demo.

Enable PDF Export

To enable PDF export:

  1. Add the pdf command to the TreeList toolbar configuration.
  2. Configure the pdf options.
  3. For large PDF documents, include the Pako library to enable compression.

The following example adds an Export to PDF button to the TreeList toolbar and configures the exported document.

<script src="https://unpkg.com/pako/dist/pako_deflate.min.js"></script>

<div id="treelist"></div>

<script>
    $("#treelist").kendoTreeList({
        toolbar: ["pdf"],
        columns: [
            { field: "Name", title: "Name" },
            { field: "Position", title: "Position" }
        ],
        dataSource: [
            { id: 1, parentId: null, Name: "Jane Doe", Position: "Chief Executive Officer" },
            { id: 2, parentId: 1, Name: "John Doe", Position: "Chief Technology Officer" }
        ],
        pdf: {
            fileName: "Employees.pdf",
            paperSize: "A4",
            landscape: true
        }
    });
</script>

Export All Pages and Configure Layout

By default, the TreeList exports the current page. Set pdf.allPages to true to export all pages, and use PDF options such as paperSize, landscape, and margin to configure the document layout.

javascript
pdf: {
    allPages: true,
    paperSize: "A4",
    landscape: true,
    margin: { top: "1cm", right: "1cm", bottom: "1cm", left: "1cm" }
}

Export Programmatically

You can call the saveAsPDF method when a user interacts with an external element to export the TreeList data to a PDF file.

javascript
$("#export").on("click", function() {
    var treeList = $("#treelist").data("kendoTreeList");
    treeList.saveAsPDF();
});

The pdfExport event fires before the TreeList saves the generated PDF. Use its e.promise argument to determine when the export completes.

See Also