Edit this page

saveAsPDF

Initiates the PDF export. Also fires the pdfExport event.

Calling this method could trigger the browser built-in popup blocker in some cases. To avoid that, always call it as a response to an end-user action e.g. button click.

Parameters##### options Object

An options object with the same structure as the pdf options.

ReturnsPromise A promise that will be resolved when the export completes. The same promise is available in the pdfExport event arguments.

Example - manually initiate PDF export

<button id="export">Export to PDF</button>
<div id="spreadsheet"></div>
<script>
    $("#spreadsheet").kendoSpreadsheet({
        sheets: [{
            rows: [{
                cells: [{ value: "A" }, { value: "B" }, { value: "C" }]
            }, {
                cells: [{ value: "1" }, { value: "2" }, { value: "3" }]
            }, {
                cells: [{ value: "4" }, { value: "5" }, { value: "6" }]
            }]
        }],
        pdf: {
            fileName: "Test.pdf"
        }
    });
    $("#export").click(function(e) {
        var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
        spreadsheet.saveAsPDF({ area: "selection" });
    });
</script>

<!-- Load Pako library to enable PDF compression -->
<script src="http://kendo.cdn.telerik.com/2018.2.620/js/pako_deflate.min.js"></script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy