Hi Lee,
Please check this Dojo example. It demonstrates the desired functionality of exporting the charts from the previously discussed Dojo project in separate pages in the exported file.
To be able to achieve the desired functionality, we have to programmatically resize the Charts before the export of the document and scale them back once the PDF is exported.
The scaling is done once on "PDF export" button click and then the resize to the original dimensions can be done using two approaches:
Approach 1: Using setTimeout function
kendo.drawing.pdf.saveAs(group, "Invoice.pdf");
setTimeout(function(){ $("#referrals").css({"width":"20%","height":"240px"}).data("kendoChart").resize();
$("#applications").css({"width":"20%","height":"240px"}).data("kendoChart").resize();
$("#users").css({"width":"50%","height":"240px"}).data("kendoChart").resize();
}, 800)
})
Approach 2: Using a callback function of the proxyUrl of the kendo.drawing.pdf.saveAs function.
kendo.drawing.pdf.saveAs(group, "Invoice.pdf", "/someurl",function(){
$("#referrals").css({"width":"20%","height":"240px"}).data("kendoChart").resize();
$("#applications").css({"width":"20%","height":"240px"}).data("kendoChart").resize();
$("#users").css({"width":"50%","height":"240px"}).data("kendoChart").resize();
});
Regards,
Petar
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.