title: C# GhostScript - Not able to successfully convert from PDF to TXT file
body: <p>I have been successful with extracting text from a PDF file using GhostScript along with the following command line arguments:</p>
  
  <pre><code>gswin32c.exe ^
    -q -dNODISPLAY -dSAFER -dDELAYBIND ^
    -dWRITESYSTEMDICT ^
    -dSIMPLE ^
    -c save ^
    -f ps2ascii.ps ^
     "test.pdf" ^
    -c quit ^
    &gt;"test.txt"
  </code></pre>
  
  <p>Points to note: I copied the following three files from the installation directory into my C:\ directory.</p>
  
  <pre>
  1)gsdll32.dll
  2)gsdll32.lib
  3)gswin32
  </pre>
  
  <p>When manually running GhostScript through the command line I do the following:
  Run > CMD > cd C:\ (then proceed to input the above arguments).</p>
  
  <p>(The above command works and a new file named "test.txt" appears in my C:\ drive with the appropriate pdf data).</p>
  
  <p><strong>When attempting to execute <code>GhostScript</code> through the command line, however, I am not successful.</strong> </p>
  
  <p>In my C# Winform Application, I am using the following code to execute GhostScript:</p>
  
  <pre><code>Process p1 = new Process();
  p1.StartInfo.FileName = @"C:\test.exe";
                      p1.StartInfo.UseShellExecute = false;
  
                      p1.StartInfo.WorkingDirectory = @"C:\";
                      p1.StartInfo.Arguments = " -q -dNODISPLAY -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps " + quote + @"C:\h.pdf" + quote + " -c quit &gt;" + quote + @"C:\test.txt" + quote;
                      File.WriteAllText(@"C:\hhh.txt", p1.StartInfo.Arguments);
                      p1.Start();
  </code></pre>
  
  <p>Does anyone see any obvious errors with my code? I would appreciate any help I can get here.</p>
  
  <p>Thanks,</p>
  
  <p>Evan</p>