[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HELP!
On Mon, 15 Dec 1997, Shai Zorea wrote:
> I have the Slackware 3.4 and I have a HP 660 printer and I do not know how to configure the printer.
> One more thing, when I write the command # lpr -the computer responds with an error that the command lpr do not exists , the same with lpq lpd lpc lprm.
> I looked under bin and those commands do not appear there.
> I do not know if they are supposed to be there, anyway if someone could give me some exact instructions on how to print under slakware it would be very nice because I couldn't find any dissenthelp file on the net!
> Thank you all
Hi,
First of all, I think Slackware 3.4 should be packaged with LPRng. It
seems you either didn't install it, or something else is broke. Anyway,
get LPRng 3.3.3, compile and install it (read the LPRng installation
manual).
After it's installed, use the following printcap entries and filters in
order to print text or postcript files with HP Deskjet 660.(works with
690, 695, 600, etc etc, all the HP deskjet series).
printcap file:
text:\
:lp=/dev/lp1:\
:sd=/var/spool/lpd/text:\
:mx#0:\
:if=/usr/local/lib/filters/djtext:\
:lf=/var/spool/lpd/text/log:\
:af=/var/spool/lpd/text/acct:\
:sh:
ps:\
:lp=/dev/lp1:\
:sd=/var/spool/lpd/ps:\
:mx#0:\
:if=/usr/local/lib/filters/djps:\
:lf=/var/spool/lpd/ps/log:\
:af=/var/spool/lpd/ps/acct:\
:sh:
(of course you'll need to create these spool directories and gibe them the
right permissions (you can run checkpc -f , it'll fix permissions,
remember to create the log and acct files in each spool directory before
running checkpc -f)
The filters are attached. Put them in /usr/local/lib/filters , and make
them mode 0755 (i.e. -rwxr-xr-x).
You also need Alladin ghostscript with the deskjet and cdeskjet drivers
compiled in for the postscript filter to work.
Regards,
--Ariel
>
> Shai Zorea Email : zorea@internet-zahav.net
>
+---------------------------------------------------------------+
| Ariel Biener |
| e-mail: ariel@post.tau.ac.il Work ph: 03-6406086 |
| fingerprint = 07 D1 E5 3E EF 6D E5 82 0B E9 21 D4 3C 7D 8B BC |
+---------------------------------------------------------------+
#!/bin/sh -f
# file: /usr/lib/hpdjflt
# version: 1.01
# by: Johan Svensson, Josnet Internetworking AB
# email: johan@jos.net
# copyright: This is freeware!
# You may distribute and modify this filter as long as
# you don't make money on it and keep the copyright
# notice within each filter.
# Copyright (C) 1994-95 Josnet Internetworking AB, Sweden
# date: 94-03-17
# last update: 95-08-21
# description: A HP DeskJet 510 in/out filter for BSD'ish lpr.
# This must be the most complete text-filter!
# Should work OK with most PCL-printers (even laser).
# notes: I intend to refine this filter in the future, but who
# knows...
# disclaimer: The commands are taken from the Swedish version of
# "HP DeskJet 510 - Printer for IBM PC and compatible
# computers - Instruction Manual" and I can't guarantee
# that everything works to a hundred percent and I don't
# take the responsibility (neither does Josnet Internetworking AB)
# if all your printers burn up...
# support: You're on your own on this one! If you find anything inte-
# resting or even bugs, you may contact the author.
#
# Good Luck!
# Sample /etc/printcap:
# ---------------------
# # Hp DeskJet 510
# hpdj|HP-DeskJet 510 on knuth:\
# :lp=/dev/lp1:\
# :sd=/usr/spool/hpdj:\
# :mx=0:\
# :of=/usr/lib/hpdjflt:\
# :sh:\
# :lf=/usr/adm/lpd-errs:
#################
# hpdjflt BEGIN #
#################
# Set up your minimal environment (your mileage may vary):
RM="/bin/rm"
CAT="/bin/cat"
SLEEP="/usr/bin/sleep"
# A suitable area to put temporary files at:
TMPAREA="/tmp"
# A suitable filename:
HPFILE=$TMPAREA/hpdjflt.$$
# redirect stdin to temporary file:
$CAT - > $HPFILE
# start by resetting the printer:
echo -ne '\033E'
# Edit the following for your needs!
# This file is more of a cookbook...
# ---------------
# PRINTER CONTROL
# ---------------
# Reset printer:
# echo -ne '\033E'
# Function test:
# echo -ne '\033z'
# ------------
# PAPER SOURCE
# ------------
# Automatic sheet feeder:
echo -ne '\033&l0H'
# Manual sheet feeder:
# echo -ne '\033&l1H'
# Envelope feeder:
# echo -ne '\033&l3H'
# ---------------
# PRINT DIRECTION
# ---------------
# Left to right:
# echo -ne '\033&k0W'
# Bidirectional:
echo -ne '\033&k1W'
# Right to left:
# echo -ne '\033&k2W'
# ---------
# UNDERLINE
# ---------
# Single fixed:
# echo -ne '\033&d1D'
# Double fixed:
# echo -ne '\033&d2D'
# Single proportional:
# echo -ne '\033&d3D'
# Double proportional:
# echo -ne '\033&d4D'
# None:
echo -ne '\033&d@'
# ----------------
# LINE TERMINATION
# ----------------
# CR=>CR, LF=>LF, FF=>FF
# echo -ne '\033&k0G'
# CR=>CR+LF, LF=>LF, FF=>FF
# echo -ne '\033&k1G'
# CR=>CR, LF=>CR+LF, FF=>CR+FF
echo -ne '\033&k2G'
# CR=>CR+LF, LF=>CR+LF, FF=>CR+FF
# echo -ne '\033&k3G'
# --------
# AUTOWRAP
# --------
# Allow:
echo -ne '\033&s0C'
# Turn off:
# echo -ne '\033s1C'
# ----------------
# OH PRINTOUT MODE
# ----------------
# Number of bit-groups:
# echo -ne '\033&p#X[data]
# -------------------
# WINDOWING FUNCTIONS
# -------------------
# On:
# echo -ne '\033Y'
# Off:
# echo -ne '\033Z'
# -------------------------
# EXTENDED PRINTING CONTROL
# -------------------------
# Row-by-row on:
echo -ne '\033&k0E'
# Row-by-row off:
# echo -ne '\033&k1F'
# ----------
# SHEET SIZE
# ----------
# Standard:
# echo -ne '\033&l0A'
# US Letter:
# echo -ne '\033&l2A'
# US Legal:
# echo -ne '\033&l3A'
# US Executive:
# echo -ne '\033&l1A'
# A4:
echo -ne '\033&l26A'
# Nr.10 envelope:
# echo -ne '\033&l-81A'
# E65 (DL) envelope:
# echo -ne '\033&l-90A'
# -----------
# ORIENTATION
# -----------
# Portrait ("and-ell-zero-oh"):
echo -ne '\033&l0O'
# Landscape ("and-ell-one-oh"):
# echo -ne '\033&l1O'
# ------------
# ROW DISTANCE
# ------------
# Rows per inch:
# echo -ne '\033&1#D'
# -----------
# PAGE LENGTH
# -----------
# Number of rows:
# echo -ne '\033&l#P'
# -----------
# PAGE BREAKS
# -----------
# On:
# echo -ne '\033&l1L'
# Off:
# echo -ne '\033&l0L'
# -----------
# HEAD MARGIN
# -----------
# Number of rows:
# echo -ne '\033&l#E'
# -----------
# TEXT LENGTH
# -----------
# Number of rows:
# echo -ne '\033&l#F'
# -------------------
# HORIZONTAL MARGINS:
# -------------------
# Left margin:
# echo -ne '\033&a#L'
# 8 columns:
echo -ne '\033&a8L'
# Right margin:
# echo -ne '\033&a#M'
# 3 columns:
echo -ne '\033&a3M'
# Remove margins:
# echo -ne '\0339'
# --------------------
# ROW DISTANCE CONTROL
# --------------------
# On:
# echo -ne '\033&k6W'
# Off:
# echo -ne '\033&k5W'
# ----------------
# CURSOR MOVEMENT:
# ----------------
# Horizontal movement index (nr of 1/120 inch movements):
# echo -ne '\033&k#H'
# Move to column nr #:
# echo -ne '\033&a#C'
# Horizontal nr (tenths of a point):
# echo -ne '\033&a#H'
# Horizontal nr (points):
# echo -ne '\033*p#X'
# Vertical movement index (nr of 1/48 inch movements):
# echo -ne '\033&l#C'
# Move to row nr #:
# echo -ne '\033&a#R'
# Vertical nr (tenths of a point):
# echo -ne '\033&a#V'
# Vertical nr (points):
# echo -ne '\033*p#Y'
# --------
# CHARSET:
# --------
# PC-8:
# echo -ne '\033(10U'
# HP Roman8:
# echo -ne '\033(8U'
# PC-8 Danish/Norwegian:
# echo -ne '\033(11U'
# PC-850:
# echo -ne '\033(12U'
# ECMA-94 Latin 1:
# echo -ne '\033(0N'
# German (ISO 21):
# echo -ne '\033(1G'
# French (ISO 69):
# echo -ne '\033(1F'
# Italian (ISO 15):
# echo -ne '\033(0I'
# Spanish (ISO 17):
# echo -ne '\033(2S'
# Swedish Names (ISO 11):
# echo -ne '\033(0S'
# Swedish (ISO 10):
# echo -ne '\033(3S'
# Norwegian1 (ISO 60):
# echo -ne '\033(0D'
# Norwegian2 (ISO 61):
# echo -ne '\033(1D'
# Portugese (ISO 16):
# echo -ne '\033(4S'
# British (ISO 4):
# echo -ne '\033(1E'
# ANSI ASCII (ISO 6):
echo -ne '\033(0U'
# JIS ASCII:
# echo -ne '\033(0K'
# HP Legal:
# echo -ne '\033(1U'
# ISO IRV:
# echo -ne '\033(2U'
# Line Draw (optional):
# echo -ne '\033(0L'
# Math7 (optional):
# echo -ne '\033(0M'
# Math 8 (optional):
# echo -ne '\033(8M'
# Math8a (optional):
# echo -ne '\033(0Q'
# Math8b (optional):
# echo -ne '\033(1Q'
# PIFont (optional):
# echo -ne '\033(15U'
# PIFonta (optional):
# echo -ne '\033(2Q'
# ------------------
# FIXED/PROPORTIONAL
# ------------------
# Proportional:
# echo -ne '\033(s1P'
# Fixed:
echo -ne '\033(s0P'
# -----
# PITCH
# -----
# Characters per inch:
# echo -ne '\033(s#H'
# 8 cpi:
# echo -ne '\033(s8H'
# 10 cpi:
echo -ne '\033(s10H'
# 12 cpi:
#echo -ne '\033(s12H'
# 14 cpi:
# echo -ne '\033(s14H'
# 16 cpi:
# echo -ne '\033(s16H'
# -------------
# TYPEFACE SIZE
# -------------
# Number of points:
# echo -ne '\033(s#V'
# 6p:
# echo -ne '\033(s6V'
# 8p:
# echo -ne '\033(s8V'
# 9p:
# echo -ne '\033(s9V'
# 10p:
# echo -ne '\033(s10V'
# 12p:
# echo -ne '\033(s12V'
# 14p:
# echo -ne '\033(s14V'
# 16p:
# echo -ne '\033(s16V'
# 18p:
echo -ne '\033(s18V'
# 20p:
# echo -ne '\033(s20V'
# 24p:
# echo -ne '\033(s24V'
# 32p:
# echo -ne '\033(s32V'
# 46p:
# echo -ne '\033(s46V'
# 64p:
# echo -ne '\033(s64V'
# 72p:
# echo -ne '\033(s72V'
# ----------
# TEXT STYLE
# ----------
# Antiqua:
# echo -ne '\033(s0S'
# Italic:
# echo -ne '\033(s1S'
# -------
# DENSITY
# -------
# Normal:
echo -ne '\033(s0B'
# Bold:
# echo -ne '\033(s3B'
# Extra bold (optional):
# echo -ne '\033(s7B'
# ----
# FONT
# ----
# Courier:
#echo -ne '\033(s3T'
# CG Times:
# echo -ne '\033(s4101T'
# Letter Gothic:
# echo -ne '\033(s6T'
# Univers:
# echo -ne '\033(s52T'
# Pica (optional):
# echo -ne '\033(s1T'
# Line Printer (optional):
# echo -ne '\033(s0T'
# Prestige (optional):
# echo -ne '\033(s8T'
# Elite (optional):
# echo -ne '\033(s2T'
# Script (optional):
# echo -ne '\033(s7T'
# Helvetica (optional):
# echo -ne '\033(s4T'
# Presentations (optional):
# echo -ne '\033(s11T'
# Times Roman (optional):
echo -ne '\033(s5T'
# CG Century Schoolbook (optional):
# echo -ne '\033(s23T'
# Brush (optional):
# echo -ne '\033(s32T'
# Dom Casual (optional):
# echo -ne '\033(s61T'
# Univers Condensed (optional):
# echo -ne '\033(s85T'
# Garamond (optional):
# echo -ne '\033(s101T'
# CG Triumvirate (optional):
# echo -ne '\033(s4T'
# -------------
# PRINT QUALITY
# -------------
# Letter (fine):
echo -ne '\033(s2Q'
# Draft:
# echo -ne '\033(s1Q'
# -------------
# FONT HANDLING
# -------------
# Font ID nr:
# echo -ne '\033*c#D'
# ASCII code nr:
# echo -ne '\033*c#E'
# Erase all fonts:
# echo -ne '\033*c0F'
# Erase all temporary fonts:
# echo -ne '\033*c1F'
# Erase latest font:
# echo -ne '\033*c2F'
# Create a temporary font:
# echo -ne '\033*c4F'
# Create a permanent font:
# echo -ne '\033*c5F'
# Create a loadable font (bytes):
# echo -ne '\033)s#W[data]'
# Load character (bytes):
# echo -ne '\033(s#W[data]'
# Choose primary font ID:
# echo -ne '\033(#X'
# Choose secondary font ID:
# echo -ne '\033)#X'
# -----------------------
# CHOICE OF PRIMARY FONTS
# -----------------------
# Primary standard:
# echo -ne '\033(#@'
# Standard character set:
# echo -ne '\033(0@'
# Current primary character set:
# echo -ne '\033(2@'
# Standard font:
# echo -ne '\033(3@'
# -------------------------
# CHOICE OF SECONDARY FONTS
# -------------------------
# Secondary standard:
# echo -ne '\033)#@'
# Standard character set:
# echo -ne '\033)0@'
# Standard primary character set;
# echo -ne '\033)1@'
# Current primary character set:
# echo -ne '\033)2@'
# Standard secondary font:
# echo -ne '\033)3@'
# ---------------------
# START BITMAP GRAPHICS
# ---------------------
# Left margin:
# echo -ne '\033*r0A'
# Current cursor position:
# echo -ne '\033*r1A'
# -------------------
# END BITMAP GRAPHICS
# -------------------
# End graphics:
# echo -ne '\033*rbC'
# ----------
# RESOLUTION
# ----------
# 75 dots per inch:
# echo -ne '\033*t75R'
# 100 dots per inch:
# echo -ne '\033*t100R'
# 150 dots per inch:
# echo -ne '\033*t150R'
# 300 dots per inch:
# echo -ne '\033*t300R'
# ----------------------------
# SET WIDTH OF BITMAP GRAPHICS
# ----------------------------
# Number of bitmap columns:
# echo -ne '\033*r#S'
# ---------------
# SET COMPRESSION
# ---------------
# Method 0 (uncoded):
# echo -ne '\033*b0M'
# Method 1 (length coded):
# echo -ne '\033*b1M'
# Method 2 (TIFF):
# echo -ne '\033*b2M'
# Method 3 (Delta Row):
# echo -ne '\033*b3M'
# Method 9:
# echo -ne '\033*b9M'
# Seed Row Source:
# echo -ne '\033*b#S'
# ------------------------
# TRANSFER BITMAP GRAPHICS
# ------------------------
# Number of bitgroups (bytes):
# echo -ne '\033*b#W[data]'
# Transfer bitmap data with planes:
# echo -ne '\033*b#V[data]'
# -----------------
# OFFSET IN HEIGHTH
# -----------------
# Number of bitmap rows:
# echo -ne '\033*b#Y'
# -------------------
# SET GRAPHIC QUALITY
# -------------------
# Draft (Graphics):
# echo -ne '\033*r1Q'
# Letter (Graphics):
# echo -ne '\033*r2Q'
# -----------------------------------
# SET NUMBER OF BITMAP PLANES PER ROW
# -----------------------------------
# Foreground colour:
# echo -ne '\033v#S'
# One-plane palette:
# echo -ne '\033*r1U'
# ------------------------
# ASSORTED BITMAP COMMANDS
# ------------------------
# Bitmap Shingling:
# echo -ne '\033*o#Q'
# Bitmap Depletion:
# echo -ne '\033*o#D'
# print out the temporary file:
$CAT $HPFILE
# end by resetting the printer:
echo -ne '\033E'
# give the system som time to process the data
# and remove the temp-file
# WARNING! This may corrupt the printout on some
# systems - leave the rm for now and figure
# out how you should deal with the temp-file.
$SLEEP 5
$RM $HPFILE
# END
#!/bin/sh -f
#
exec 9>&1 1>&2
device=cdeskjet
gsoutput="cat 1>&9"
gs -q -dNOPAUSE -sDEVICE=${device} \
-dBitsPerPixel=24 \
-dNOPLATFONTS \
-sPAPERSIZE=a4 \
-sOutputFile=\|"${gsoutput}" -
- Follow-Ups:
- Re: HELP!
- From: Oron Peled <oron@actcom.co.il>
- References:
- HELP!
- From: Shai Zorea <zorea@internet-zahav.net>