Convert Postscript to Text file using ghostscript
<p>my client wants me to do one task. which is whenever I print <code>ctrl+P</code> from the browser it will go automatically that contents to the database which is sql.</p>

<p>Now, Let me explain what I have tried to achieve this. Usually <a href="http://printerplusplus.com" rel="nofollow">printerPlusPlus</a> which is third party tool. Which adds virtual printer and prints the files <code>PS</code> to the temp directory than I can read the contents of that postscript file and save it to the database. </p>

<p>My real question is there anything from which I can convert this post script files to text or read them and save the texts to the database? 
Or is there any better way to achieve this task?</p>

<p>Ghostscript is the alternate and ow-some feature to convert the postscripts to the text or pdf. But, I am completely clueless about the documentation and how to execute their commands.</p>

<pre><code>_viewer.Interpreter.RunFile("C:\\PrinterPlusPlus\\Temp\\ankit_SONY-VAIO_sony_20151227_185020_3.ps");

            GhostscriptPngDevice dev = new GhostscriptPngDevice(GhostscriptPngDeviceType.Png16m);
            dev.GraphicsAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
            dev.TextAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
            dev.ResolutionXY = new GhostscriptImageDeviceResolution(96, 96);
            dev.InputFiles.Add(@"C:\\PrinterPlusPlus\\Temp\\ankit_SONY-VAIO_sony_20151227_185020_3.ps");
            dev.OutputPath = @"C:\\PrinterPlusPlus\\Temp\\ankit_SONY-VAIO_sony_20151227_185020_3.txt";
            dev.Process();

            _preview.Activate();
</code></pre>

<p>I tried this but this seems to be not working and adding ASCII text to the txt file.</p>