Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux General question

Posted on 1997-09-11
2
Medium Priority
?
303 Views
Last Modified: 2013-12-03
I have been trying for a while to get my canon bjc-240 to work under Linux.
 I have read the printing-HOWTO, but still have a few questions...

I am able to cat text to the printer, but I get a staircase effect.  I
understand that I need to set up filters in lpd to take care of this...
What is the easiest way to go about this?

When I do lpr filename, I get the message: connection to lp@myhostname
failed - connection refused.

What am I doing wrong?  If anyone has the same printer, your lpd.conf and
printcap would be extremely helpful.

Thanks a lot!
0
Comment
Question by:justj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
jeffa072897 earned 0 total points
ID: 1626683

Here is what I use for a local attached printer.

This is a script file called "print" in /usr/bin which is chmod 755

cat $1|/usr/bin/lpfilter|/usr/bin/lpr -Phpj

This is a staircase filter that I found in the origional Linux Bible boot. The file is caled lpfilter and lives in /usr/bin.

#!/bin/sh
if [ "$1" = -c ]; then
  cat
else
/ sed -e s/$/
fi
# the ''echo -ne'' assumes that /bin/sh is really bash
echo -ne \\f

Lastly here is my printcap file -

# Generic printer:
#lp:lp=/dev/lp1:sd=/usr/spool/lp1:sh
#lp|genicom|local:lp=/dev/lp1:if=/usr/lib/lpd/lpf:sd=/usr/spool/lp1:sh:
lp|genicom:if=/usr/bin/lpfilter::rp=raw:\
        :rm=BEDFORD_POLOCK_PRT:sd=/usr/spool/lp1:sh:
#
# HP Laser jet plus
hpj|lp2:\
        :lp=:rm=dprint:\
        :sd=/usr/spool/lp2:

One important note. If your printer is networked then you must pipe through the filter before giving the data to lpr. The lpd daemon that comes with Linux dosent support filters to network filters. Here's an example of what I mean -

Take a file and put in the following -
cat $1|/usr/bin/lpfilter|/usr/bin/lpr -Plp
chmod the file 755 and call it as file <file to print>



0
 

Author Comment

by:justj
ID: 1626684
I still get 'connection refused'.  Checked /etc/lpd.perms, everything looks fine...  Thanks for the answer, Jeff.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question