fitraditya / node-pdf2img

A nodejs module for converting pdf into image file
MIT License
76 stars 51 forks source link

Why is coming this err #28

Open chhaunkar96 opened 7 years ago

chhaunkar96 commented 7 years ago

I am a beginner plz help me. C:\Users\kaushal-pc\Desktop\nodejs\pdf2img>node pdf2img.js 'gm' is not recognized as an internal or external command, operable program or batch file. child_process.js:533 throw err; ^

Error: Command failed: gm identify -format "%p " "C:\Users\kaushal-pc\Desktop\nodejs\pdf2img/bharati.pdf" 'gm' is not recognized as an internal or external command, operable program or batch file.

at checkExecSyncError (child_process.js:490:13)
at execSync (child_process.js:530:13)
at C:\Users\kaushal-pc\Desktop\nodejs\node_modules\pdf2img\lib\pdf2img.js:72:23
at fn (C:\Users\kaushal-pc\Desktop\nodejs\node_modules\pdf2img\node_modules\async\lib\async.js:638:34)
at Immediate.<anonymous> (C:\Users\kaushal-pc\Desktop\nodejs\node_modules\pdf2img\node_modules\async\lib\async.js:554:34)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)

==========================pdf2img.js============================

var fs = require('fs'); var path = require('path'); var pdf2img = require('pdf2img'); var input = __dirname+'/bharati.pdf'; pdf2img.setOptions({ type:'png', size:1024, denesity:600, output:'testx' }); pdf2img.convert(input,function (err, info) { if(err) console.log(err); else console.log(info);
});

JoK-rgb commented 7 years ago

I have the same issue

fitraditya commented 7 years ago

Hello, seems like you used this module on windows. Currently it only support Linux dan OSX.

chhaunkar96 commented 7 years ago

thank you

amithealthist commented 7 years ago

Hi, I am also getting the same problem. I am using OSX.

/bin/sh: gm: command not found

fitraditya commented 7 years ago

Have you install graphicmagick? Please install it first (using homebrew).

danielchenyy commented 6 years ago

Hi,I'm have the same issue.And I'm using CentOS6.9. I had installed the graphicmagick.

Error: Command failed: gm identify -format "%p " "/node/images/public/imgs/xxxxxxxxxx.pdf" /bin/sh: gm: command not found

newasmod commented 6 years ago

Hello, people, this still occurs on my too! How to fix this! Are any maintenance?

newasmod commented 6 years ago

@fitraditya i have installed it with brew, also installed with npm , also tried with sudo apt, nothing works, . Please HELP! i use linux min 18.1 its like ubuntu @amithealthist have you fixed it?

Avinash2189 commented 6 years ago

when i download a zip file from github,' sqlite example' for react native and installing it on my phone getting the same error.any help...