-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
I have a screenshot image taken from an HTML5 Canvas. It may be taller than one page or span the equivalent of multiple pages in the PDF. How do I set the addImage options so that it will use the actual height of the canvas?
I tried using canvas width and height, but it just zooms and blurs.
I can't find any documentation on jsPDF addImage() to see if there is a way to adjust the options to have a single image with a height that adjusts.
Here is my code
var element = $('#report');
html2canvas(element, {
onrendered: function(canvas) {
var doc = new jsPDF('landscape');
var dataUrl = canvas.toDataURL('image/jpeg');
doc.addImage(dataUrl,0,0,canvas.width,canvas.height);
doc.save('MeterPhotosReport.pdf');
}
});
Thanks,
Don
bahmutskyi, quetzaluz, braulley, seanprashad, joaobarcia and 8 more
Metadata
Metadata
Assignees
Labels
No labels