var
var fs = require('fs'),
convertFactory = require('electron-html-to');
var conversion = convertFactory({
converterPath: convertFactory.converters.PDF
});
conversion({ html: '<h1>Hello World</h1>' }, function(err, result) {
if (err) {
return console.error(err);
}
console.log(result.numberOfPages);
console.log(result.logs);
result.stream.pipe(fs.createWriteStream('/path/to/anywhere.pdf'));
conversion.kill(); // necessary if you use the electron-server strategy, see bellow for details
});
European Badger