<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js" integrity="sha384-NaWTHo/8YCBYJ59830LTz/P4aQZK1sS0SneOgAvhsIl3zBu8r9RevNg5lHCHAuQ/" crossorigin="anonymous"></script>
yarn add jspdf
import jsPDF from 'jspdf';
var doc = new jsPDF('p', 'px', 'letter'); //orientation, unit, format
doc.text('hello world', 200, 50); //string, x-position, y-position
var image = new Image();
image.src = 'images/reactLogo.png';
doc.addImage(image, 'PNG', 300, 80, 50, 50); //base64 image, format, x-coordinate, y-coordinate, width, height

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store