node-pdf2img icon indicating copy to clipboard operation
node-pdf2img copied to clipboard

[Error: Command failed: gm identify -format "%p "

Open donniekerr opened this issue 6 years ago • 4 comments

Why do I get this error? [Error: Command failed: gm identify -format "%p "

I have gm and gs packages installed.

I am running locally on a Windows machine, but istalling GraphicsMajik's exe did not help. Any suggestions? Ultimately my goal is to get it running in an Azure Function. Thanks, Donnie

donniekerr avatar Sep 16 '18 15:09 donniekerr

here is my code snippet if you need it `

fs.writeFile(__dirname + "/input/" + fileName, pdfBlob, err => {
if (err) {
  context.log(err);
} else {
  context.log("The PDF has been saved temporarily since it only works with local file path, not blob!");

  let input = __dirname + "/input/" + fileName;
  pdf2Img.setOptions({
    type: "png",
    size: 1024,
    density: 600,
    quality: 100,
    outputdir: __dirname + "/output/",
    outputname: null,
    page: null
  });

  pdf2Img.convert(input, function(err, info) {
    if (err) {
      context.log(err);
      context.done();
    } else {
      context.log(info);

      context.done();
    }
  });
}});

`

donniekerr avatar Sep 16 '18 15:09 donniekerr

so, did you solve this problem,I meet the same error.

RicardoScofileld avatar Jun 06 '19 03:06 RicardoScofileld

so, did you solve this problem,I meet the same error.

i am also having the same problem. If anyone has a solution, can you please help?

simaybocu avatar Apr 22 '22 11:04 simaybocu

pdfBlob

这是我的代码片段如果你需要的话 '

fs.writeFile(__dirname + "/input/" + fileName, pdfBlob, err => {
if (err) {
  context.log(err);
} else {
  context.log("The PDF has been saved temporarily since it only works with local file path, not blob!");

  let input = __dirname + "/input/" + fileName;
  pdf2Img.setOptions({
    type: "png",
    size: 1024,
    density: 600,
    quality: 100,
    outputdir: __dirname + "/output/",
    outputname: null,
    page: null
  });

  pdf2Img.convert(input, function(err, info) {
    if (err) {
      context.log(err);
      context.done();
    } else {
      context.log(info);

      context.done();
    }
  });
}});

`

`

hello, What does pdfBlob mean?

lzdml avatar Apr 24 '24 03:04 lzdml