Skip to content

Instantly share code, notes, and snippets.

@cjpartridgeb
Created September 25, 2012 01:27
Show Gist options
  • Save cjpartridgeb/3779439 to your computer and use it in GitHub Desktop.
Save cjpartridgeb/3779439 to your computer and use it in GitHub Desktop.
Simplest possible wkhtmltopdf 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