I have an HTML page with around 10 charts generated by chart.js (so these are canvas elements). I want to be able to export the page content into a PDF file.
I’ve tried using jsPDF’s .fromHTML function, but it doesn’t seem to support exporting the canvas contents. (Either that or I’m doing it wrong). I just did something like:
$(".test").click(function() {
var doc = new jsPDF()
doc.fromHTML(document.getElementById("testExport"));
doc.save('a4.pdf')
});
Any alternative approaches would be appreciated.