2

Is there any way to set opacity for images and text in jsPdf. I was looking in the documentation didn't find any option to do that. https://mrrio.github.io/jsPDF/doc/symbols/jsPDF.html

Snippet to add image to pdf is here http://mrrio.github.io/jsPDF/

Purushoth
  • 2,673
  • 3
  • 22
  • 36

1 Answers1

-1

Try using the jsPDF addHTML plugin. That way, you can style your images and text using HTML and CSS, and add it to the PDF using jspdf.addHTML. See how to use addHTML function in jsPDF. There's also an addHTML example in the link you posted (http://mrrio.github.io/jsPDF/).

Another option would be to edit the opacity of the image and text via drawing it on a canvas, editing the opacity of the canvas, then adding the data URL of the canvas to the PDF using addImage.

Community
  • 1
  • 1
Villager
  • 604
  • 6
  • 15