title: GhostScript output to file
body: <p>I use GhostScript to check for corrupt pdf files using the following command:</p>
  
  <pre><code>gswin64c.exe -o nul -sDEVICE=nullpage input.pdf
  </code></pre>
  
  <p>and I get the following output on the screen:</p>
  
  <pre><code>Processing pages 1 to 2.
  Page 1
    *****Error reading a content stream. The page may not be incomplete.
  Page 2
    *****Warning: File has insufficient data for an image.
  
    *****This file had errors that were repaired or ignored.
  </code></pre>
  
  <p>This information is exactly what I need but I need this output in a text file as I will have to process a large number of files.</p>
  
  <p>I tried to use the following command:</p>
  
  <pre><code>gswin64c.exe -o outputfile.txt -sDEVICE=txtwrite input.pdf
  </code></pre>
  
  <p>but the outputfile is empty.</p>
  
  <p>How can I output these information into the file?</p>