Discussion Locked

Printing Configuration Files

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Okay, I'm having a brain fade here and I hope someone can help me out. I'm running RH Linux v6.2 and have a networked LaserJet4 printer and need to print some plain-vanilla old script and configuration files for documentation purposes.

I've tried groff -me test.doc | lpr and every other variant I could think of using pr, groff, cat and so on.

Anyone have a quick and easy way to print these plain-ASCII files so they look like they do on the terminal (in other words, no stairstepping or other formatting problems that result in making it difficult to read)?

Thanks in advance!

paul

6 replies

by ddiall

The HP printers, as DOS, use CR+LF to delimit the end of a line. Unix/Linux systems use only LF.

You must add a CR (carriage return) before (or after) the each LF (line feed). To accomplish this use standard tools like 'sed', 'awk' or maybe 'tr'...

The best way is to create a print queue that uses ghostscript to convert the plain ASCII text to LaserJet format. Use RedHat's printtool for this. By hand, do it like this:

# gs -DEVICE=ljet4 -OUTPUTFILE=test.lj4 test.txt

by mckaytech

I finally found the answer. In the input queue in Printtool, I clicked "fix stair-stepping" and then used 'pr l60 "textfile" | lpr'.

paul

by ddiall

Yeah right, I forgot two things: first, you must put 's' after the dashes (-s); second, ghoscript only accepts PostScript as input files:

# gs -sDEVICE=ljet4 -sOUTPUTFILE=test.lj4 test.ps

by mckaytech

Thanks! I appreciate the additional information. Printtool with it's "fix stairstepping" option did the trick.

This discussion is closed to new replies.