Solved

Linux General question

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What does GoogleTagMgr javascripts below do 5 53
NTPD Client Port Usage 12 60
postfix start error! 9 48
Code Coverage and Coding Standards 2 43
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

685 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