Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
almoraleslopez opened this issue Apr 28, 2014 · 13 comments · Fixed by #87
Closed

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

almoraleslopez opened this issue Apr 28, 2014 · 13 comments · Fixed by #87
Assignees
Labels

Comments

@almoraleslopez
Copy link

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.

@bpampuch
Copy link
Owner

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

@bpampuch bpampuch added the bug label Apr 29, 2014
@bpampuch bpampuch self-assigned this Apr 29, 2014
@jeffleus
Copy link

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.

@hisham
Copy link

hisham commented Jul 7, 2014

+1. I'm also getting this.

@d-a-v-e
Copy link

d-a-v-e commented Jul 11, 2014

me too

@kofno
Copy link

kofno commented Jul 16, 2014

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.

@rohitgirme
Copy link

+1. I get this too.

@deogadekunal
Copy link

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.

@rohitgirme
Copy link

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

@Kienz
Copy link

Kienz commented Aug 8, 2014

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

@honi
Copy link

honi commented Sep 8, 2014

Regarding the "No unicode cmap for font", it looks like it is a pdfkit issue.
See: foliojs/pdfkit#121
And it looks like some progress was made in order to fix this for some fonts: foliojs/pdfkit#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?

@bpampuch
Copy link
Owner

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

@infacq
Copy link

infacq commented Dec 17, 2014

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

@jacksnose
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.