HTML page to PDF (angular js and d3 diagrams)
3 answers
You can use Kendo by setting the "id" to the container you want to export and then use the following code:
kendo.drawing.drawDOM($("#exportthis"), {
paperSize: "letter",
margin: "0.5cm",
scale: 0.5
}).then(function(group) {
kendo.drawing.pdf.saveAs(group, "Converted PDF.pdf");
});
in your view you need to set the id like in this example:
<div id="exportthis" class="...">
... more HTML code here...
</div>
then a button where we can call the function and its ready to go.
I use this when I don't need a pdf image like jspdf / pdfmake.js that use canvas.
0
source to share