pdf - Trouble using PDFkit with Meteor -


i using pdfkit meteor , getting error

object has no method 'writesync'

can tell me package contains method? missing something?

my packages include:

  • meteorhacks:async
  • meteorhacks:npm
  • npm-container
  • cfs:filesystem
  • cfs:standard-packages
  • pascoual:pdfkit

the documentation contains meteor add pascoual:pdfkit , suggests add 2 fibered methods writesync , outputsync, not found.

can help?

m using pdfkit in server side using 2 alternatives:

  1. rounting: lib/router.js

    router.route('/createpdf/:_paramid', function() { var paramid = this.params._paramid; if (!paramid) return;

    var doc = new pdfdocument({     size: 'a4',     margins: {         top: 50,         bottom: 0,         left: 50,         right: 50,     } });  doc.image(process.env.pwd + '/public/sample1.jpg', 0, 30);  this.response.writehead(200, {     'content-type': 'application/pdf',     'content-disposition': 'attachment; filename=somename.pdf' }); this.response.end(doc.outputsync());}, { where: 'server' }); 

and, calling client using:

router.go('/createpdf/' + someparamid); 
  1. calling meteor method

    meteor.call('createpdf', paramid);

and changing pdf building method

meteor.methods({     createpdf: function(paramid) {           if (!paramid) return;          var doc = new pdfdocument({             size: 'a4',             margins: {                 top: 50,                 bottom: 0,                 left: 50,                 right: 50,             }         });          doc.image(process.env.pwd + '/public/img/sample1.jpg', 0, 30);          ....          doc.writesync(process.env.pwd + '/public//pdf/' + pdfname + '.pdf');     } }); 

i have 1 trouble, doesn't work in blabla.meteor.com test app, server cannot found images using doc.image(...)


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -