Error 'TypeError: jsPDF is undefined' when using jsPDF-AutoTable

1

Apparently the error originates in the file: \lib\jspdf-autotable\dist\jspdf.plugin.autotable.js .

I'm using nodeJS and angularJS 1.3 Just do the bower install.. and in my config file add this:

  

'public / lib / jspdf-autotable / dist / jspdf.plugin.autotable.js',   'public / lib / jspdf / dist / jspdf.min.js'

and when loading the page it throws me the aforementioned error. Or failing that, I would appreciate the recommendation of another tool for the creation of PDF

    
asked by dámazo 15.02.2017 в 18:45
source

1 answer

0

The order of the files affects the result: you can not load the plugin for JSPDF before loading JSPDF, because there will be dependencies that will cause these failures to occur. And not only for JSPDF, in general all extensions / plugins / modules / etc. of a library or framework must be loaded after loading that library or framework so that they work correctly.

Put this in the config and try again:

  

'public / lib / jspdf / dist / jspdf.min.js', 'public / lib / jspdf-autotable / dist / jspdf.plugin.autotable.js'

    
answered by 15.02.2017 / 19:40
source