Solved

Linux General question

Posted on 1997-09-11
2
295 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will giveā€¦
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

777 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