hhurz / tableExport.jquery.plugin

jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
MIT License
990 stars 716 forks source link

jsPDF AutoTable plugin v2.3.0 not working. Needs to be updated! #141

Open arivera12 opened 7 years ago

arivera12 commented 7 years ago

This is the error I am receiving on the console: Uncaught TypeError: Cannot read property 'fontSize' of undefined at http://localhost:54638/scripts/table-export.min.js:195:83 at Array.forEach (native) at Object.function.d.beforePageContent.d.beforePageContent (http://localhost:54638/scripts/table-export.min.js:193:88) at undefined.t.afterPageContent.undefined.t.beforePageContent.undefined.t.afterPageAdd.undefined.t.addPageContent.t.addPageContent (http://localhost:54638/scripts/jspdf.plugin.autotable.min.js:10:17653) at Object.l [as addContentHooks] (http://localhost:54638/scripts/jspdf.plugin.autotable.min.js:10:5655) at Object.o.API.autoTable (http://localhost:54638/scripts/jspdf.plugin.autotable.min.js:13:1678) at HTMLDivElement. (http://localhost:54638/scripts/table-export.min.js:215:134) at Function.each (http://localhost:54638/scripts/jquery.min.js:3:3168) at n.fn.init.each (http://localhost:54638/scripts/jquery.min.js:3:703) at http://localhost:54638/scripts/table-export.min.js:191:24

hhurz commented 7 years ago

Just updated to jsPDF version 1.3.2 and verified that it works for me without any changes. Cannot confirm this issue without any further information.

arivera12 commented 7 years ago

I think the problem is on the jspdf.autotable.js plugin and not on jspdf itself. Take a look of the screenshot... image

My jspdf.autotable.js plugin version is v2.3.0

arivera12 commented 7 years ago

Yup, the problem is the autotable plugin. I tested the version here on this repo which is v2.0.14 and its works out of the box. It seems they have renamed a lot of functions and properties on v2.3.0. Are you updating the autotable plugin to the last version or are you just going to stay on the current version of this repo? This may give you some headache if people doesnt dowload the plugins which ishosted on this repo as I did... I dont think it should be a big deal to do it.

hhurz commented 7 years ago

I'm not planing to update autotable plugin in the near future. Doing this would need some rework of the tableexport plugin code, because there are fixes and tweaks in it, that refere to this special version of jsPDF Autotable. Furthermore I'm thinking about to integrate the portions of code that the tableexport plugin uses from the autotable plugin, so there will no more depencies from it any more. Anyway, both solutions would need some time... BTW: You are the first one, who stumbled over it ;-)