Posts: 71
jtwdyp
Joined: 08 Apr 2012
#1
I'm a multi-boot Linux user with roots in the old kde3 but who has converted to enlightenment {e17} ever since kde4 (with the exception of a few apps that I still prefer to use....)

Today I created a text file"tmp.txt" containing a US postal mailing address that my lady wanted me to print for her. (she can't read my handwriting) She was going to buy and mail a card while she was out. Her ride was outside and beeping it's horn so there wasn't enough time to reboot into one of my other linux distro's to reissue the:

lpr tmp.txt

command from {after logging into the cups server to cancel the bad print job on the default (and only) local usb HP D4160 printer.}

So after clearing the cups job I returned to the terminal window and typed:

kwrite tmp.txt

And used kwrite's menu commands to print the file...
Then after my lady left with the printed output I recreated the cups print error via another:

lpr tmp.txt

command...

The cups jobs tab said:
{note: extra tab/spaces were inserted to try to realign the label/value columns }

Code: Select all

Showing 1 of 1 active job.
▼ ID ▼        Name         User          Size    Pages        State        Control
D4160-18     Unknown     Withheld     1k     Unknown      stopped 
"PDF file is damaged - attempting to reconstruct xref table..."
I note that the D4160 was installed using the:
Driver: HP Deskjet d4100 Series, hpcups 3.12.2 (color, 2-sided printing)

Why would cups expect lpr to send the print data as a pdf?

If lpr IS supposed to convert the text file to a pdf for cups, why would it fail to do so for a text file that kwrite doesn't have a problem with?

What am I missing?????
Last edited by jtwdyp on 25 Jun 2012, 13:41, edited 1 time in total.
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#2
Maybe this bug report will help:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673289"
linktext was:"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673289"
====================================


If you can use lpr to print pdf or ps files but not plain text files, a work-around might be to install and use the"enscript" package that converts plain text files to postscript for printing. You would print text files with:

Code: Select all

$ enscript tmp.txt
You can set default configurations in ~/.enscriptrc and/or /etc/enscript.cfg and /etc/enscriptsite.cfg.

Edit: The a2ps utility can be used instead of enscript.
Posts: 71
jtwdyp
Joined: 08 Apr 2012
#3
BitJam wrote:Maybe this bug report will help:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673289"
linktext was:"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673289"
====================================
Hmmnnn... Well I don't know. My problem didn't produce a blank page. And I wasn't {to my knowlege} using a cups filter that presumed my printer was either a postscript or pdf printer...

I note, however, that most of that bugreport is definately over my head, so I could be wrong.
BitJam wrote:If you can use lpr to print pdf or ps files but not plain text files, a work-around might be to install and use the"enscript" package that converts plain text files to postscript for printing. You would print text files with:

Code: Select all

$ enscript tmp.txt
You can set default configurations in ~/.enscriptrc and/or /etc/enscript.cfg and /etc/enscriptsite.cfg.

Edit: The a2ps utility can be used instead of enscript.
I was unaware thar lpr could print ps/pdf files on a NON-postscript printer. (If I needed to print one of those, I would normally open it with okular or evince and hit ^p...)

But since:

Code: Select all

lpr somefile.pdf
did work, I installed enscript and added:

Code: Select all

alias lpr="enscript -B $*"
to my ~/.bashrc

Which seems to work.

But, while I still don't know if lpr or cups is doing this wrong {it just doesn't feel right that lpr (which I think origianally stood for lineprint on Unix) should need plain text converted to pdf or PS format to feed it to the cups driver for a NON PS printer...} But at least the enscript kludge works. The only problem is that if they ever actualy fix lpr and/or the cups driver to handle lineprinting again, I'll never know cause I'll still be using my alias... {sigh!}

Of course I shouldn't be surprised since all the traditional"business grade" printers I ever saw at work {when I last worked in the corporate environment (a now defunct Lucent Tech manufacturing facility)} were all postscript lzor printers. So I shouldn't be surprised if every thing is geared to PS compatability.

Thanks for the useful reply BTW...