0

In Windows how can I use RedMon EE , Ghostscript, GSview , Nenscript for Windows to convert a text file to postcript and redirect it to a printer .

Something like to configure "RPT1: Redirected Port" with the values C:\Program Files\Ghostgum\gsview\gsprint.exe

for the "Redirect this port to the program" and

-printer "Windows Printer Name" -copies 1 - for "Arguments"

and additionally use enscript in order to receive a text file as input .

famedoro
  • 1,223
  • 2
  • 17
  • 41

1 Answers1

0

You don't need most of those.

Apprently nenscript can convert text files to PostScript, so use nenscript to do that. Then use Ghostscript and specifically the mswinpr2 device to render to a Windows printer.

Of course, if the printer understand PostScript you don't even need to use Ghostscript, you can simply send the PostScript program direct to the printer.

You're also pointing to a very old version of Ghostscript there, 8.64, you really want to be using the current version 9.27 which is available from www.ghostscript.com. Version 8.64 is 10 years old now.

Edit

If it's a GDI printer then you need to get Windows to package the data and send it to the printer, using the Windows printer driver. To do that you need to have Ghostscript render the input to an image, then send the bitmap to the Windows printing pipeline using the mswinpr2 device.

So use nenscript to create the PostScript file (let's call it input.ps) then something like

gswin64c -sDEVICE=mswinpr2 -sOutputFile=%printer%My_Printer input.ps

The documentation for the Windows printing device can be found here.

halfer
  • 19,824
  • 17
  • 99
  • 186
KenS
  • 30,202
  • 3
  • 34
  • 51
  • the printer is a GDI Printer (or windows printer), could you give me an example ? – famedoro Apr 23 '19 at 08:27
  • I need everything to happen in a single command line where the output of one is the input of the next, and everything is transparent to the user (this is the reason why I use the virtual RPT1 port) how can I do it ? – famedoro Apr 23 '19 at 09:44
  • I don't know what you mean by 'everything is transparent to the user'. You could write a PostScript program to read the text and lay it out, then send that program to Ghostscript with the text file as an argument each time. You could write a batch file to do the two operations and run the batch file with the name of text file as an argument. You could use Linux (or WSL) and pipe the output from one command into the input of the next. I don't see how a virtual printer port helps. – KenS Apr 23 '19 at 10:02