Trying to print with lpr produces blank pages

revrari

New Member


Messages: 5

I am trying to setup my printer to print using lpr from the command line. My goal is to be able to print documents created in vi with nroff formatting. I have managed to set up my printer using CUPS and if I print in a non-terminal application printing works fine. If however, I print in the terminal, although the printer responds and "prints", it prints out blank pages. This is the case even for a simple text file, as in:

Code:
lpr txt.txt

I have read this link:
I have followed the instructions there.
This is the text I have in my /etc/printcap file:

Code:
lp:\
    :lp=/dev/ulpt0:\ 
    :sh:\
    :mx#0:\
    :sd=/var/spool/lpd/lp:\
    :lf=/var/log/lpd-errs:
I also have lpd_enable="YES".

I would appreciate any suggestions.
 

covacat

Well-Known Member

Reaction score: 170
Messages: 365

you probably need an input filter to convert the file in the printer language (pcl, postscript etc)
 

shepper

Aspiring Daemon

Reaction score: 322
Messages: 874

There are 2 utilities that will process plain text into a postscript file. print/a2ps and print/enscript-letter. I've seen examples where these utilities are incorporated into print filters, but I personally have never been able to get the filters to automatically detect *.txt input and output the print job as postscript. No problem with breaking it down into 2 steps though or setting a printer in the configuration for for each utility.
 
OP
R

revrari

New Member


Messages: 5

Thank you for your remarks. If I print as follows, I get most of the nroff formatting, but not the underlining or italics:

Code:
nroff experience | /usr/local/bin/lpr -P Brother_HL-L2360D_series

I then added this filter to /etc/printcap:

Code:
:if=/usr/libexec/lpr/lpf:

However it made no difference.
 
Top