I am using jspdf.debug.js to export different data from a website but there are a few problems, I can\'t get it to render the CSS in the exported PDF and if I have an image
Slight change to @rejesh-yadav wonderful answer.
html2canvas now returns a promise.
html2canvas(document.body).then(function (canvas) { var img = canvas.toDataURL("image/png"); var doc = new jsPDF(); doc.addImage(img, 'JPEG', 10, 10); doc.save('test.pdf'); });
Hope this helps some!