I'm using this library to render a barcode in HTML, using JavaScript:
https://github.com/lindell/JsBarcode/
The rendered barcode is an html <svg> with <rect>'s in it
Any hints on how to add this barcode to my PDF using jsPDF ?
Will the html-to-pdf feature work?
Answer:
HTML:
<canvas id="barcode"></canvas>
Javascript:
JsBarcode("#barcode", "hello im a barcode");
var jpegUrl = $("#barcode").toDataURL("image/jpeg");
doc.addImage(jpegUrl, 'JPEG', 0, 0);
Most helpful comment
Answer:
HTML:
Javascript: