HP Printer setup.

HP Printer setup.

Post by Andrew Matheng » Sat, 26 Apr 1997 04:00:00



I have a problem setting up a filter for a HP4si (and HP3si) printer
for printing simple ascii files.

I know that I can use a2ps to convert the ascii file to postscript and
then send it... but I would like to be able to use simple text editors
to send it and have the filter applied automatically.

Advise please... with some examples.

Thanks in advance.

Andrew.

 
 
 

HP Printer setup.

Post by J Wuns » Sun, 27 Apr 1997 04:00:00



> I know that I can use a2ps to convert the ascii file to postscript and
> then send it... but I would like to be able to use simple text editors
> to send it and have the filter applied automatically.

Install apsfilter from the ports.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

HP Printer setup.

Post by J Wuns » Sun, 27 Apr 1997 04:00:00



> I know that I can use a2ps to convert the ascii file to postscript and
> then send it... but I would like to be able to use simple text editors
> to send it and have the filter applied automatically.

Install apsfilter from the ports.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

HP Printer setup.

Post by Annelise Anderso » Mon, 28 Apr 1997 04:00:00



Quote:> I have a problem setting up a filter for a HP4si (and HP3si) printer
> for printing simple ascii files.
> I know that I can use a2ps to convert the ascii file to postscript and
> then send it... but I would like to be able to use simple text editors
> to send it and have the filter applied automatically.
> Advise please... with some examples.
> Thanks in advance.
> Andrew.

apsfilter is pretty good....but you can also put an entry for a
"printer" in /etc/printcap; I have one that looks like this (the
printer is called pcl or lp4, and there's no separate spooler set
up for it):

pcl|lp4:\
        :lp=/dev/lpt0:\
        :sd=/var/spool/ljet2p-raw:\
        :lf=/var/spool/ljet2p-raw/log:\
        :af=/var/spool/ljet2p-raw/acct:\
        :if=/usr/home/andrsn/bin/setup:\
        :mx#0:\

The "if" line above calls a script file "setup" that looks like this:

#!/bin/sh

printf " E &k3G" && cat && printf "\f" && exit 0
exit 2

so when I want to print I just type lpr -Ppcl filename
In the above, the ^[ before the E (if it made it through Usenet)
is a decimal 027 entered in vi (in insert mode) with ctrl-V<esc>

The directory in which this file resides needs to have 755 permissions.

Here's another option--a shell script called qp (for quick print) that
prints a file with the command qp filename

#!/bin/sh

awk -f ~/bin/qp.awk $1 | lpr

This above shell script calls qp.awk and sends the file to the
printer; here's qp.awk:

BEGIN {
        printf(" E &k3G (s0p12v0s0b3T &a06L")
        }
$0 ~ (/\n/)
        {print}
END {
        printf(" E")

Quote:}

This little awk script initializes a printer that speaks PCL (rather
than postscript), tells the printer to deal with unix line endings,
sends a font string to the printer, and also sends a left margin to
the printer.  All lines of the file (including blanks) are printed.
In the end block the script sends the printer initialization code
again.  (There are four 027's in the above.)

Here's another awk script, called in a similar manner, that changes
tabs to spaces, good for printing code that would otherwise fall off
the page, because the Laserjets I use think a tab deserves 8 spaces:

BEGIN {
        printf(" E &k3G (s0p12v0s0b3T &a04L")
        TABLEN = "  "
        }
$0 ~ (/\n/)
        {
        if ( match($0,/^[ \t]+/ ))
                {
                gsub(/\t/,TABLEN,$0 )
                print $0}
        else print $0}
END {

Quote:}

Finally, I got sufficiently frustrated even having apsfilter, because
I still would have had to learn *roff, TeX/LaTeX, or how to code
postscript to actually produce documents that had different type
faces, bold, underlining, italics, and so forth in them that I wrote
a couple of awk scripts to deal with files created with a text editor
that having PCL printer codes in them.  Alternatively you can use
the staroffice port (really terrific, but takes a lot of space) or--
what seems to be a rather common quick solution--mark up the text
with HTML and print it with Netscape (to do that you may need to have
apsfilter installed.

So there are some examples.

Annelise

 
 
 

1. Network HP printer setup help!!

Can anyone help me to setup the apsfilter so that I can print to a Jetdirect
print server for HP LaserJet 5L?

I'm using SuSE 6.1 at the moment, I can print to the printer but the result
is rubbish.

I can do it quite easily under RedHat's printtool. Is there anything
similiar tool I can use under SuSE?

Many thanks

2. Grayscale card & X11R5

3. HP Printer Setup -- SuSE 5.3

4. custom kernel hangs at "configuring modules" during floppy bootup

5. HP printer setup

6. internet access questions....

7. HP Printer Setup

8. Help - serial vs ethernet connected pc's

9. HP-Printer Setup

10. hp printer setup

11. Urgent: Printer setup for ascii text on an HP printer ...

12. Printer setup using NetBSD-1.3 and HP 692c Deskjet Printer

13. Urgent: Printer setup for ascii text on an HP printer ...