pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

Minified version not working - Tested with Chrome & Firefox & Angularjs 1.2.4

Open almoraleslopez opened this issue 12 years ago • 13 comments

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.

almoraleslopez avatar Apr 28 '14 17:04 almoraleslopez

thanks for reporting, I'll try to take a look at it tomorrow

bpampuch avatar Apr 29 '14 23:04 bpampuch

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.

jeffleus avatar May 16 '14 04:05 jeffleus

+1. I'm also getting this.

hisham avatar Jul 07 '14 23:07 hisham

me too

d-a-v-e avatar Jul 11 '14 10:07 d-a-v-e

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.

kofno avatar Jul 16 '14 13:07 kofno

+1. I get this too.

rohitgirme avatar Jul 25 '14 21:07 rohitgirme

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 avatar Jul 29 '14 07:07 deogadekunal

@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.

rohitgirme avatar Jul 29 '14 13:07 rohitgirme

+1. I got the error "No unicode cmap for font". The non-minified version works!

Kienz avatar Aug 08 '14 12:08 Kienz

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?

honi avatar Sep 08 '14 13:09 honi

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

bpampuch avatar Sep 12 '14 12:09 bpampuch

@rohitgirme do you mind sharing with me how do use async plugin on requireJs

infacq avatar Dec 17 '14 02:12 infacq

Has anyone continued to experience this error, even when using the non-minified version?

jacksnose avatar Dec 18 '15 22:12 jacksnose