# Trying to print with lpr produces blank pages



## revrari (May 28, 2021)

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:


```
lpr txt.txt
```

I have read this link:








						Chapter 10. Printing
					

This chapter covers the printing system in FreeBSD




					docs.freebsd.org
				



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


```
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 (May 28, 2021)

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


----------



## shepper (May 29, 2021)

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.


----------



## revrari (May 29, 2021)

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


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

I then added this filter to /etc/printcap:


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

However it made no difference.


----------

