var doc = new jsPDF()
doc.text(20,20,'This is a title')
doc.text(20,30,'This is some normal sized text underneath')
As you can see in the index.html file we have just included two files first the jspdf library script file and second one is the custom script file which we have written. Apart from that there is nothing to talk about.
In the script.js file we have written some lines of code which needs to be explained so the first line is getting the reference of the library in a doc variable. After that we are using the methods of library to set the font size and also the text to the pdf document and lastly in order to save the file in a pdf format we are using the method of doc.save which will download the file instantly for us when we run the script in the browser.
A programmer scientist by the mind and a passionate blogger by heart ❤️. Fountainhead of Coding Shiksha Life motto: Live while you can! Teach & inspire while you could & Smile while you have the teeth.Gautam Sharma