NilsDannemann / meteor-pdfmake

Pdfmake Package for Meteor
14 stars 1 forks source link

TypeError: pdfMake.createPdf is not a function #16

Open tomvolek opened 7 years ago

tomvolek commented 7 years ago

I am using meteor 1.5 . I have a simple button to call the event template for creating a PDF from a collection list (as it is stated in the example) . However I get the error : TypeError: pdfMake.createPdf is not a function . Any thoughts ?

import pdfMake from 'meteor/nilsdannemann:pdfmake';

Template.report_user_purchase.events({ 'click #print_button': function() { var customerPurchase = Purchased.find({username: Meteor.userId()}); // Define the pdf-document var docDefinition = { content: [ 'Some text', customerPurchase, 'Some text' ] }; pdfMake.createPdf(docDefinition).open(); } });

tomvolek commented 6 years ago

after upgrading to meteor 1.6 and latest pdfmake npm the above started working magic :)