wrapper for weasyprint pdf generator
npm install weasyprint-wrapper
npm i weasyprint-wrapper
`
Example use
`javascript
const weasyprint = require('weasyprint-wrapper');
//specify the location of weasyprint cli if not in PATH
weasyprint.command = '~/programs/weasyprint';
// URL
weasyprint('http://google.com/', { pageSize: 'letter' })
.pipe(fs.createWriteStream('out.pdf'));
// HTML
weasyprint('Test
Hello world
')
.pipe(res);
// Stream input and output
var stream = weasyprint(fs.createReadStream('file.html'));
// output to a file directly
weasyprint('http://apple.com/', { output: 'out.pdf' });
// Optional callback
weasyprint('http://google.com/', { pageSize: 'letter' }, function (err, stream) {
// do whatever with the stream
});
``