Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Since upgrading to Ubuntu 12.04, the printing of plain text files with lpr on my HP LaserJet 2420 printer malfunctions in a very specific way: for each character that is supposed to be printed, the character that is actually printed is the one whose ASCII code is precisely 2 plus the ASCII code of the correct character. For instance echo "A" | lpr prints the letter C and echo "Z" | lpr prints the symbol \ and so forth. I have installed the standard hplip library. Does anyone know what might be causing this weird problem, and how to fix it?

share|improve this question
    
What printing system is this? Is there perhaps a bug report for this issue at Ubuntu? Everything up to date? All printing systems pass the input through a series of filters, check how you can find out what those filters are, and how they are run. Then you can go over each of them until you find the culprit. –  vonbrand Apr 3 '13 at 21:54
    
Thank you for your suggestions. Lpr is one of the two standard UNIX printing systems, the other being enscript. To the best of my knowledge, there is no bug report on this "ASCII value plus 2" issue at Ubuntu. Everything on my machine is up to date. I ought to have mentioned that my problem does NOT occur with enscript, only with lpr. –  Greg Marks Apr 4 '13 at 1:03
    
Many Linux systems and MacOS use CUPS. That the "user visible command" is lpr is just for backwards compatibility. –  vonbrand Apr 4 '13 at 1:05
    
Yes, the hplip library I mentioned does include CUPS backend drivers. –  Greg Marks Apr 4 '13 at 1:15
add comment

1 Answer

The same weird problem has occurred on a second computer that was upgraded from Ubuntu 10.04 to Ubuntu 12.04, connected to a different model HP LaserJet printer.  The cause and solution remain a mystery; however, Postscript printing still works, so the problem can be circumvented by a function such as the following in $HOME/.bashrc:

Lpr () {
paps --paper=letter --font="Courier 11" --bottom-margin=44 --top-margin=40 --left-margin=42 --right-margin=38 "$1" | /usr/bin/lpr
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.