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

How use package with meteor 1.3? #9

Open
the-evgenii opened this issue Apr 19, 2016 · 9 comments
Open

How use package with meteor 1.3? #9

the-evgenii opened this issue Apr 19, 2016 · 9 comments

Comments

@the-evgenii
Copy link

import { pdfMake } from 'meteor/nilsdannemann:pdfmake';

and got

Cannot read property 'createPdf' of undefined
@NilsDannemann
Copy link
Owner

Hey jmlv,
please just use the original npm package of pdfMake. This package is really just a wrapper for the original and since meteor 1.3 there's no reason to use it.

I'll update the Readme accordingly tomorrow.

@the-evgenii
Copy link
Author

with npm package same problem :)

@EddyBorja
Copy link

Same issue here, any solution?

@EddyBorja
Copy link

Also, trying to use the NPM package by itself gives me an error where fs.readFileSync is not defined. How did you make this package work?

@tnedich
Copy link

tnedich commented Sep 11, 2016

Same thing here ! I belive that fonts.js is making some problem. To novice and amateur to figure what is that problem.

@bswiswa
Copy link

bswiswa commented Sep 23, 2016

I'm having the same problem as well and I'm using it in my Meteor application. Did anyone get it to work?

@EddyBorja
Copy link

I couldn't figure this out so I ended up using the pdfmake-browserified npm package.

@bswiswa
Copy link

bswiswa commented Sep 25, 2016

I tried the pdfmake-browserified npm package and it works! Thanks a lot @EddyBorja.
The package actually works for me now @NilsDannemann. The problem I had was that the qr codes that were generated were mirror images of what they should be and I needed to swap the x and y coordinates so I was unminifying your pdfmake.min.js and editing it then minifying it again but I wasn't doing it right. It works now. Thanks for having this package!

@matt90410
Copy link

matt90410 commented Oct 13, 2016

Today I tried using pdfmake with Meteor and had the same 'cannot read property of undefined' error. I am needing the pdf to be created server side, so was not able to use the pdfmake-browserified version. So I decided to investigate the issue.

It turns out to be to do with pdfmake using 'lodash' which conflicts with underscore used in Meteor (both want to use the '_' variable.

The solution, while not ideal was to install erasaur:meteor-lodash (which gives you a 'lodash' variable) and then comment out in the pdfmake/src code any '_' = require('lodash') commands. Then going through the pdfmake replacing the _. commands with lodash. commands.

As I say, not ideal - but I have now got it producing PDF's.

Hope this helps someone.

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

No branches or pull requests

6 participants