Unusable with CSP directives
mrudelle opened this issue ยท 14 comments
Ref to issue foliojs/pdfkit#757
This line evaluates generated code and thus cannot be used on projects relying on CSP. (without adding the unsafe-eval
directive)
I'd like also to stress that all my big project is not on green with Google CSP validator merely because of this issue, through pdfmake.
pdfmake admin refers:
Pdfmake using pdfkit library for creating pdf files, this has a dependency on restructure library where eval is used. It can not be replaced by another library. Pdfmake can not solve this problem, it must be resolved in restructure library.
Exists issue #28 and PR #22 in restructure. We can only wait for a new version of restructure library.
Anyway, thanks for the free library and let us wait :)
+1
Should be fixed by #34. Released in v2.0.0.
When will datatables with pdfmake include v2.0 - or is there a way to force it to use version 2.0 so that I can use native capability for PDFS that match my tables?
You can try https://www.npmjs.com/package/pdfmake-lite. It does not supports IE
@thomasazdon pdfmake not using v2.0 because dependency on restructure is in fontkit and there was no new version with restructure v2.0.
Reopened.
Issue is not fixed completely:
restructure/src/VersionedStruct.js
Lines 9 to 10 in b9e40d2
Thanks for fixing this! Will there be a release soon so that pdfmake can be used without the CSP unsafe-eval
?
@flip-it, as stated at bpampuch/pdfmake#1360 a lot of things have to happen for a new pdfmake release.
a new release of restruture is a tiny step. fontkit is still pinned at restructure v0.5.4. fontkits current babel (v6) implementation does not like the new es6 style of restructure 2.x. I tried playing around with it, but ran into issues with rollup, which is out of date (v0.34.13 is 3ยฝ years old), and fontkits own creator has since authored Parcelโฆ
For compatibility with new restructure in fontkit is ready in foliojs/fontkit#225 and foliojs/fontkit#196.
But merge and release a new version of restructure and fontkit @devongovett has to do it.