Home > Articles > Operating Systems, Server

  • Print
  • + Share This

Printing PostScript and DOS Command Files

One problem with printing under Win31 and Win95 with the LPR methods discussed is the lack of a "raw" LPT1: device. This is annoying to the administrator who wants to print an occasional text file, such as a file full of printer control codes, without their being intercepted by the Windows printer driver. Of course this is also an issue with DOS programs, but a commercial site that runs significant DOS software and wants to print directly to UNIX with LPR really has only one option—to use a commercial TCP/IP stack containing a DOS LPR program.

Normally under Windows printing, virtually all graphical programs print through the Windows printer driver. This is true even of basic programs such as Notepad. For example, an administrator may have a DOS batch file named filename.txt containing the following line: echo \033&k2G > lpt1:. This batch file switches a HP LaserJet from CR-LF, MS-DOS text file printing into Newline termination UNIX text file printing. Otherwise, raw text printed from UNIX on the HP prints with a stairstep effect.

If the administrator opens this file with Notepad and prints it using a regular printer driver, such as an Epson LQ, the Windows printer driver encapsulates this print output into a series of printer-specific control codes that do things such as initialize the printer, install fonts, and so on. The printer won't interpret this output as control code input. Usually if the printer is locally attached, the user can force a "raw text print" of the file by opening a DOS window and running

copy filename.txt lpt1: /b

Since the LPR client program doesn't provide a DOS driver, it cannot reroute input from the LPT1: device ports. The solution is to use the Generic/Text Only printer driver in conjunction with Wordpad (under Win95); under Win31, use a different text editor. The Notepad editor supplied with Windows is unsuitable for this: it "helpfully" inserts a one-inch margin of space around all printed output, as well as the filename title. Wordpad supplied with Win95 can be set to use margins of zero, and it inserts no additions into the printed output. Make sure that banner pages are turned off and that the print type is set to RAW.

 

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.