Quantcast
Viewing all articles
Browse latest Browse all 41

Convert Postscript to Text file using ghostscript

my client wants me to do one task. which is whenever I print ctrl+P from the browser it will go automatically that contents to the database which is sql.

Now, Let me explain what I have tried to achieve this. Usually printerPlusPlus which is third party tool. Which adds virtual printer and prints the files PS to the temp directory than I can read the contents of that postscript file and save it to the database.

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?

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.

_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();

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


Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>