Reputation: 15
How can I get a hand drawn signature onto the PDF? I have a jquery mobile report which the customer signs at the end. After the signature is drawn on the canvas it is displayed back to the customer.
I am then converting the report to PDF using JSPdf. I am displaying text, tables, and a logo with no problem, but this signature thing has really stumped me. With a normal pic you just convert to a URI and the pic is displayed but all I am getting with the signature is the URI.
Upvotes: 0
Views: 2798
Reputation: 15
The answer was as simple as finding the generated image. Thank you once again.
var SigImg = document.getElementById("sig-image");
doc.addImage(SigImg, 'png', 20, 20, 100, 40)
Upvotes: 1
Reputation: 2854
Use signaturepad.js jQuery plugin to generate base64 coded signature image. Use that code as image src in htmltopdf in jspdf
Upvotes: 1