NickNaso / ghostscript4js

Ghostscript4JS binds the Ghostscript C API to the Node.JS world.
http://www.nacios.it
Apache License 2.0
66 stars 19 forks source link

Problem calling execute method multiple time consecutively #15

Closed NickNaso closed 7 years ago

NickNaso commented 7 years ago

The module raise a problem calling async execute method multiple times as reported below:

let cmd = '-sDEVICE=pngalpha -o my1.png -sDEVICE=pngalpha -r144 my.pdf'
let cmd2 = '-sDEVICE=pngalpha -o my2.png -sDEVICE=pngalpha -r144 my.pdf'
gs.execute(cmd, function (err) {
  if (err) {
    console.log("Ooops... something wrong happened")
  }
})
gs.execute(cmd2, function (err) {
  if (err) {
    console.log("Ooops... something wrong happened")
  }
})
NickNaso commented 7 years ago

It will be solved in version 2.0 of the module. It will be released in two weeks.

rmeja commented 7 years ago

It's not a bug but a feature :wink: https://ghostscript.com/doc/current/API.htm#new_instance

NickNaso commented 7 years ago

Refactor on version 2.0.0 solved the issue