PDF meteor shower template

Can I convert one of my meteor patterns to a PDF file? i.e. build a template, and then insert a flatulence point into it and save it as a file / data that supports formatting and style, etc.

I looked at pdfkit, but as far as I can tell, this requires manually creating pdf code in the code.

+6
source share
2 answers

Try phantomjs . Follow them rasterize an example to create a pdf. You should only download this library on the server side, as it is large.

+1
source

Try something like this:

if(Meteor.is_server) { var exec; var file = "myPdf.pdf"; var cmd = "wkhtmltopdf2 -q /tmp/" + file + ".html /tmp/" + file + ".pdf"; Meteor.startup(function() { exec = __meteor_bootstrap__.require('child_process').exec; }); exec(cmd, function(error, stdout, stderr) { console.log(stdout ? stdout : stderr); }); } 
0
source

All Articles