Ghostscript suppress output windows when called by command line

…衆ロ難τιáo~ 提交于 2019-12-23 08:04:35

问题


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?


回答1:


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...



来源:https://stackoverflow.com/questions/28340019/ghostscript-suppress-output-windows-when-called-by-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!