我正在尝试使用pdf2img模块将Pdf页面转换为图像。我的代码如下..
var pdf2img = require('pdf2img');
var input = __dirname + '/pd.pdf';
pdf2img.setOptions({
type: 'png', // png or jpeg, default png
size: 410, // default 1024
density: 200, // default 600
outputdir: __dirname + '/output' // mandatory, outputdir must be absolute path
});
pdf2img.convert(input, function(info) {
console.log(info);
});
运行上面代码后出现以下错误..
C:\node\app>node conv.js
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn pdfinfo ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)