stdout - Prevent Ghostscript from writing errors to standard output -


I am using ghostscript to initialize the first page of the PDF file. In order to avoid making tempfiles, PDF data is piped in the stools of Ghoshippates and JPEG is "lowered" on the stadium. This pipeline works like a magic until GS gets invalid PDF data: instead of reporting all error messages on stderr, I expected it still writes some messages instead of stdout .

To Reproduce:

$ resonant "PDF No" & gt; Test.txt $ / usr / bin / gs -q -sDEVICE = jpeg -dBATCH -dNOPAUSE -dFirstPage = 1 -dLastPage = 1 \ -r300 -sOutputFile = - - & lt; Test.txt 2 & gt; / Dev / null Error: / Uncategorized Faculty Stack: Execution Stack: ...

Note that 2> / Dev / null does not have to press the error message above. Ghostscript's documentation has already warned that in order to write stdout, pressing the message at stdout requires a -q flag, but I still do not remember anything.

If you want to embarrass actually Ghostscript, Modify the command line:

  / usr / bin / gs -q \ -sstdout =% stderr \ -sDEVICE = jpeg \ -dBATCH \ -dNOPAUSE \ -dLastPage = 1 \ -r300 \ -sOutputFile = - \ - & lt; Test.txt 2 & gt; Additional postscript script / dev / null  

-sstdout =% stderr allows redirecting stdout, while still allowing drivers to write at stdout gives . (This patch is in GhostScript since 2001-2001, Sept. 22).


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -