I am trying to use jsPDF and jspdf-autotable in my Angular 5.2.0 project. My package.json is below (related parts):
\"dependencies\": {
...
\"jspdf\"
If you could use declare var jsPDF: any; it is working for Chrome, IE and other browsers too, but it is not working for Firefox browser.
In this case, you could follow the below steps:
declare const require: any;
const jsPDF = require('jspdf');
require('jspdf-autotable');
and other parts remain same like:
npm install jspdf --save
npm install @types/jspdf --save-dev
npm install jspdf-autotable --save
"scripts": [
"../node_modules/jspdf/dist/jspdf.min.js",
"../node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js"
],
So, it will defiantly work on all the browsers. how simple it is :)