trying to export my CartJS to PDF file using JavaScript.
I've found a solution for jsPDF ,and its working but the generated PDF view is too small.
This is my chart:
My code:
html2canvas($("#canvasChart"), {
onrendered: function(canvas) {
var imgData = canvas.toDataURL({
format: 'jpeg',
quality: 0.9 // compression works now!
});
var doc = new jsPDF("l", "mm", "a4");
doc.addImage(imgData, 'PNG', 100, 100);
doc.save('sample-file.pdf');
}
});
I will be very thankful for help and explanation what I am doing wrong. Thanks in advance,