How can i use jsPDF in my ionic project?


#1
  1. I have installed jsPDF using npm command

I googled and followed this topic:

Now in my component.ts file when i write -

let jsPDF = require('jspdf');

It says > [ts] cannot find name require.

Please advise , how to get rid of the error ?


#2

Look at this solution => https://github.com/MarouaneSH/Ionic-jsPdf-Html2Canvas
You need to import @types for jsPDF