Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Re: How to generate a pdf file using javascript?

$
0
0

Here is my code

var myImg=new Image();

  myImg.src=arrData['employee'][1]['Image'];

  myImg.crossOrigin ="Anonymous";

   var imgData = this.getBase64Image(myImg);

   var doc = new jsPDF();

   doc.setFontSize(40);

   doc.text(35, 25, "Test Image");

   doc.addImage(myImg, 'JPEG', 15, 40, 180, 160);

   doc.save("sample1.pdf");

 

I'm receiving the following error at 'addImage' function.

Uncaught Error: getJpegSize could not find the size of the image


Could you please help in pointing out where am I going wrong.


Thank You


Viewing all articles
Browse latest Browse all 8124

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>