Solved

Linux General question

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

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linux 13 75
How do I pull the base url for use in html links 7 31
QQ problem 22 43
Start Auto-download of File when page loads? 1 21
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

856 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