Insert image in pdf with javascript

0

I have a PDF already created for which I want to insert an image, I tried with the library of jsPDF but I could only create a new PDF does not modify one already created, will anyone know any way to do it?

This is what I have:

var canvas = document.getElementById("canvasFirma");
var ctx = canvas.getContext("2d");

var doc = new jsPDF();

doc.text(20, 20, 'Hola Mensaje');
doc.addImage(canvas.toDataURL("image/png"), 'PNG', 30, 30);
doc.save('test.pdf');
    
asked by Alejandro Reyes 20.12.2017 в 16:31
source

1 answer

-1

Test:

var imgData = 'ruta';
doc.addImage(imgData,'tipoImagen', x,y);
    
answered by 30.10.2018 в 22:01