Skip to content

Instantly share code, notes, and snippets.

@cjpartridgeb
Created September 25, 2012 02:05
Show Gist options
  • Save cjpartridgeb/3779554 to your computer and use it in GitHub Desktop.
Save cjpartridgeb/3779554 to your computer and use it in GitHub Desktop.
Simple wkhtml stream example
var spawn = require('child_process').spawn;
var output = require('fs').createWriteStream(__dirname + '/test.pdf');
var wk = spawn('wkhtmltopdf', ['-', '-']);
wk.stdout.pipe(output);
wk.stdin.end('<b>Test</b>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment