title: Ghostscript to convert pdf to text and keep PDF file table format
body: <p>I have this code that converts a PDF to Text file:</p>
  
  <pre><code>gswin32c -dBATCH -dNOPAUSE -dSAFER -dDELAYBIND -dWRITESYSTEMDICT 
  -dSIMPLE -sDEVICE=txtwrite -dTextFormat=2 -dFirstPage=1 -dLastPage=1 
  -sOutputFile=C:\out.txt C:\in.pdf
  </code></pre>
  
  <p>It works almost fine, the only thing it does not keep the PDF table formatting.</p>
  
  <p>Example:</p>
  
  <p>In the PDF file:</p>
  
  <pre><code>Type    From        Name             Name2                   Code         Week
  Regular 30/03/15    KNOWLES, BEN     HOOT KNOWLES, ANGELA    367-739-746  80.00       
  Regular 30/03/15    RICHARDS, COLE   ROBERT HARRIS, BRADIE   401-844-307  108.00      
  Regular 30/03/15    SKEELS, MATT     BISHOP, JASON GREGSON   413-980-291  112.00
  </code></pre>
  
  <p>After convert it to text file, the text gets wrapped like this:</p>
  
  <pre><code>Type From Name Name2 Code Week
  Regular30/03/15KNOWLES, BENHOOT KNOWLES, ANGELA367-739-74680.00       
  Regular30/03/15RICHARDS, COLEROBERT HARRIS, BRADIE401-844-307108.00      
  Regular30/03/15SKEELS, MATTBISHOP, JASON GREGSON413-980-291112.00
  </code></pre>
  
  <p>I need it to keep its formatting. Any idea how to keep the formatting?</p>
  
  <p>I am using <code>Ghostscript gswin32c</code> on windows 7 machine, version is 9.16.</p>
  
  <p>Also, I am open to suggestions for others way to archive it.</p>
  
  <p>Cheers</p>