Hello.
We currently use
kendo.drawing.drawDOM
kendo.drawing.exportPDF
kendo.saveAs
to export the whole web page to PDF file.
But now there is a new task to create single PDF export file containing several web pages of our application.
I have already found that there is a possibility to create multi-page PDF using "multiPage" parameter
kendo.drawing.exportPDF(root, {
paperSize: [1070, height],
multiPage: true,
});
Also I found out that it is possible to append new Group to MasterGroup object using "append" method (https://docs.telerik.com/kendo-ui/api/javascript/drawing/group/methods/append)
kendo.drawing.drawDOM(element, {
scale: 0.65
}).then(function (root) {
pdfMasterGroup.append(root);
return kendo.drawing.exportPDF(pdfMasterGroup, {
paperSize: [1070, height],
multiPage: true,
});
});
The problem is I don't know how to save Group object when another web page is loaded. I tried to convert Group object to JSON string using
JSON.stringify(root)
JSON.stringify(root)
But this command fails due to circular structure of object
Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'init'
| property 'options' -> object with constructor 'init'
| property '_observers' -> object with constructor 'Array'
--- index 0 closes the circle
at JSON.stringify (<anonymous>)
Have you faced such a problem? Is the a way to populate single PDF with several web/DOM pages?