Inist-CNRS / ghostscript-js

Just a nodeJS wrapper for ghostscript
MIT License
12 stars 6 forks source link

Capture stdout from ghostscript #11

Open mhirsch opened 3 years ago

mhirsch commented 3 years ago

Is there an easy way to capture stdout from the ghostscript process? Some drivers, for example tiffsep produce meaningful output in stdout.

Thanks

rmeja commented 3 years ago

Maybe I could put the the stdout in the second parameter of the callback function (function (codeError, stdout)) ? What do you think ?

mhirsch commented 3 years ago

It seems like your exec function most closely follows the semantics of node's child_process.execFile in that it returns all results after the process exits. I would follow the same pattern that child_process does here. Thanks for considering this!

rmeja commented 3 years ago

It will be more complicated than expected to do this. The gsapi_set_stdio function takes as parameter a function pointer which forces me from the instance of my class to use a static method of my class and not a method of my object. :thinking: