This is a migrated thread and some comments may be shown as answers.

Exporting multiple charts (and grids) to PDF

1 Answer 739 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 04 Oct 2017, 10:58 PM

Hello,

I found this helpful example on exporting multiple charts to PDF:

http://demos.telerik.com/kendo-ui/pdf-export/index 

 

We have the need to put in a header and footer in our PDF. Is it possible to do that?

 

Here is our code:

    $(document).on("click", "#btnPdf", function () {

        // Convert the DOM element to a drawing using kendo.drawing.drawDOM
        kendo.drawing.drawDOM(".my-results-page-container")
        .then(function (group) {
            // Render the result as a PDF file
            return kendo.drawing.exportPDF(group, {
            });
        })
        .done(function (data) {
            // Save the PDF file
            kendo.saveAs({
                dataURI: data,
                fileName: "My Test PDF.pdf"
            });
        });
    });

We use the drawDOM function. Is it possible to use a pageTemplate? If so, I can't find any documentation on that subject...can someone help?

Thank you!

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 06 Oct 2017, 11:18 AM
Hello, Richard,

Currently, these are the supported properties when exporting the page content with multiple elements:

https://docs.telerik.com/kendo-ui/api/javascript/drawing/pdfoptions

There is an option to set a template, but the templates only work if the paperSize is not auto, which is not always acceptable when exporting multiple elements:

http://dojo.telerik.com/aBUpi/7

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Charts
Asked by
Richard
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or