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

-dNOPAUSE not working #43

Closed GuiJordao21 closed 4 years ago

GuiJordao21 commented 5 years ago

Even if i pass this flag, my program still waits for the key to be pressed. Did someone have the same problem?

NickNaso commented 5 years ago

Hi @GuiJordao21 , could you report which version of Node.js and Ghostscript you are using?

GuiJordao21 commented 5 years ago

GPL Ghostscript 9.26 (2018-11-20) node -v 10.15.3

I used the sample code on documentation. when I run the same cmd on bash, everything works fine.

NickNaso commented 5 years ago

@GuiJordao21 could you try to execute the following code?

'use strict'

const gs = require('ghostscript4js')

async function run() {
     // Take decision based on Ghostscript version
     const version = gs.version()
     console.log(version)
     await gs.execute('-psconv -q -dNOPAUSE -sDEVICE=pngalpha -o my.png -sDEVICE=pngalpha -r144 my.pdf')
}

run().catch( err => { console.error(err) })
GuiJordao21 commented 5 years ago

Sorry for the delay.

This worked fine, but some pictures are diferente of what I was expecting and I think is because of pngalpha. Don't really know the diference between this one and png16m though.

But why this worked and the other code snippet doesn't?