Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ghostscript suppress output windows when called by command line

This is my scenario:

I'm converting PDF files to PNG images calling Ghostscript by C#. This is the argument string I use:

-dNOPAUSE -dBATCH -dFirstPage=1 -q -r300   -sDEVICE=png256 -sOutputFile=...

But, in this way, when I call Ghostscript it shows a window where (before I've added -q) there were output messages.

I've tried adding -dNODISPLAY after -r300. But in this way Ghostscript doesn't work and doesn't create images.

Question: In which way can I suppress the output window?

like image 823
SamDroid Avatar asked Feb 05 '15 09:02

SamDroid


1 Answers

If you want to run Win32/Win64 Ghostscript on the commandline without having it popping up a separate window (to display its <stdout> and <stderr> messages and allow you for <stdin> input typing), then use these binaries (depending on your version of your locally installed Ghostscript):

  • gswin32c.exe (note the added c for command/console)
  • gswin64c.exe (note the added c for command/console)

Do not use gswin32.exe or gswin64.exe! These are the versions which bring along their own popup windows...

like image 144
Kurt Pfeifle Avatar answered Oct 19 '22 20:10

Kurt Pfeifle