I need to get the output of a grid saving to pdf without sending the resulting PDF directly to the user. For example, a PDF export option "localexport: true" which would return the data to code instead of directly to the client.
Currently, the file data can be retrieved using the private _drawPDF method:
var grid = $("#grid").data("kendoGrid");
var progress = new $.Deferred();
grid
._drawPDF(progress)
.then((root) => {
return kendo.drawing.exportPDF(root, grid.options.pdf);
})
.done((data) => {
console.log(data);
});
Example: https://dojo.telerik.com/rjEORuHy.
However, the approach does not work well in all scenarios for example, when there are multiple pages - https://dojo.telerik.com/iiifASYZ/2
Thus, I would like to have a built -in method that will be suitable for all scenarios to generate and retreive the file data, without sending the file to the client.