I have installed React using create-react-app. It installed fine, but I am trying to load an image in one of my components (Header.js, file path: <
create-react-app
Header.js
we don't need base64 , just give your image path and dimensions as shown below.
import Logo from './Logo.png' //local path
var doc=new jsPDF("p", "mm", "a4"); var img = new Image(); img.src =Logo; doc.addImage(img, 'png', 10, 78, 12, 15)