Minified version not working - Tested with Chrome & Firefox & Angularjs 1.2.4
Hi.
I'm trying to get pdfmake working with Angularjs, but when I try to use the minified version it is not working.
With createPdf(dd).open() is not working (No error message) With createPdf(dd).print() I have this error message: Error: No unicode cmap for font at a.registerTTF (pdfmake.min.js:3:10521) at new a (pdfmake.min.js:3:8885) at d.b.exports.font (pdfmake.min.js:5:506) at n.provideFont (pdfmake.min.js:7:5740) at pdfmake.min.js:7:13190 at Array.forEach (native) at i (pdfmake.min.js:7:13048) at c.buildInlines (pdfmake.min.js:7:13653) at c.measureLeaf (pdfmake.min.js:6:13905) at build/pdfmake.min.js:6:13070
With no-minified version is working fine.
thanks for reporting, I'll try to take a look at it tomorrow
I am also getting the "no unicode cmap for font" error at a.registerTTF. I am working on an Ionic/AgnularJS project that I would like to add pdf reports to. I have included the pdfmake.min.js as well as the vfs_fonts.js files and setup the basic document definition. But when I try to print or getDataUrl(), I get the cmap error. Is there something I am not doing correctly w/ the font? Is this only supposed to be used on the server-side w/ a nodeJS site? EDIT: after re-reading OP comments, I tested w/ the non-minified version and it works fine. So, the issue is specifically w/ the minified version.
+1. I'm also getting this.
me too
I was using this with rails. The non-minified file worked fine, but once minified by the asset pipeline (in production), I get this exact same error in the browser.
+1. I get this too.
I am developing an mobile app which require pdf generation in cordova using pdfmake, bower, but var docDefinition = { content: "This is an sample PDF printed with pdfMake" }; pdfMake.createPdf(docDefinition).open(); is not working and showing any error too.
@deogadekunal If you are using the minimized version, there seems to be an issue. However i recently used the non minimized version in Chrome. It should be in the 'build' folder -> pdfmake.js. I used RequireJS to pull in pdfmake.js and vfs_fonts.js. I used the async model of RequireJS. This worked for me.
+1. I got the error "No unicode cmap for font". The non-minified version works!
Regarding the "No unicode cmap for font", it looks like it is a pdfkit issue. See: https://github.com/devongovett/pdfkit/issues/121 And it looks like some progress was made in order to fix this for some fonts: https://github.com/devongovett/pdfkit/pull/276
But since pdfmake uses a fork of pdfkit, that commit is not yet merged. @bpampuch is there any chance you could update your pdfkit fork?
I'll update pdfkit in a few hours, I just have to remove brfs dependencies so it doesn't embed standard fonts. Otherwise pdfmake grows to 1.4 MB
@rohitgirme do you mind sharing with me how do use async plugin on requireJs
Has anyone continued to experience this error, even when using the non-minified version?