Add image in pdf using jspdf

前端 未结 12 689
离开以前
离开以前 2020-12-05 06:49

I am using jspdf to convert an image into a PDF.

I have converted the image into a URI using base64encode. But the problem is that there are no errors or warnings sh

12条回答
  •  时光取名叫无心
    2020-12-05 07:33

    I find it useful.

    var imgData = 'data:image/jpeg;base64,verylongbase64;'
    
    var doc = new jsPDF();
    
    doc.setFontSize(40);
    doc.text(35, 25, "Octonyan loves jsPDF");
    doc.addImage(imgData, 'JPEG', 15, 40, 180, 180);
    

    http://mrrio.github.io/jsPDF/

提交回复
热议问题