我是nodejs的新手,我遵循了源码指南: - https://github.com/devongovett/node-wkhtmltopdf
每当我跑咕噜声时,我都会Fatal error: write EPIPE
。知道为什么吗?
var file_output = 'output.pdf';
console.log("Warming up");
var wkhtmltopdf = require('wkhtmltopdf');
console.log("wkhtmltopdf started");
wkhtmltopdf('<h1>Hello!</h1>',{ pageSize: 'letter' }, function (err, stream) {
if (err) {
console.log('wkhtmltopdf error : ', err);
} else {
console.log("Converting!!");
var createstream = stream.pipe(fs.createWriteStream(file_output));
console.log('Done!');
});