SUMMARY: HP LaserJet IIsi, NewsPrint, and duplex mode (Source at bottom)

From: odt@dcs.bellcore.com
Date: Tue Sep 15 1992 - 17:56:20 CDT


I wrote:

>
> NetSurfers,
>
> We recently purchased a HP LaserJet IIIsi and would like to use the
> beast in PostScript mode. The printer works fine using Transcript 2.2;
> however, we are having trouble getting the thing to switch into duplex mode
> (two page/front and back) printing with those printers.
>
> We noticed that there is duplex and tumble support in NewsPrint for
> the HP IID aand IIIP but only in PCL mode -- we only deal with PostScript
> around here.
>
> Does anyone have filters that work with either NewsPrint or Transcript
> that support this???
>
> Thanks,
>
> -dan

I got responses from the following people:

          markh@analogy.com (Mark Holm)
          bchivers@smiley.mitre.org (Brent Chivers)
          birger@vest.sdata.no (Birger A. Wathne)
          Gustavo Vegas <gustavo@davinci.concordia.ca>
          jpl@allegra.att.com (John P. Linderman)
          bb@math.ufl.edu

In order, they said:

    I need this also, if you get an answer. Last couple of filters that I tried
    to write that did this, locked the printer up.

  < Here you go! >

And

    This is your LUCKY DAY! Just a week or 2 ago I made mods to
    TranScript here to give us duplex printing on our IIISi's.
    I made changes to pscat, psroff (we don't use ptroff, but the
    mods there would be similar), enscript, and their man pages.

 < Brent sent me code that implemented duplex mode with an option - >
 < Not what I wanted but extremely helpful - thanks Brent! >

And

    The fastest way you can run your HP's is to remove your postscript cartridges,
    get full NeWSprint licenses for them, and connect them to a parallel
    port. This way, your Sun will do the postscript processing, and will
    download everything as bitmaps to the printer. HP III is almost as
    fast as the SPARCprinter when you do this (And even faster for ASCII
    files).

    There was a test in Sun Expert a little while ago.

    (Just thought i would mention it, in case you were using postscript
    cartridges)

    Birger

  < Not an option - we have to get things working with our current >
  < resources. After all, we're all programmers here and this is just >
  < embedding a couple of postscript lines into a stream right?!? >

And

    Hello,
        I know of a PD package called psf, which can be used in combination
    with the printcap (as a filter) or as a command from the shell. It's
    easy to configure, and has especial handling for different printers,
    the HPIIIsi included. Of course, this package only handles PostScript
    printers. You may be able to find it via anonymous ftp on ftp.uu.net in
    /usenet/comp.sources.misc/volume28/psf3 +
    /usenet/comp.sources.misc/volume30/psf3
    for the patches, or pit-manager.mit.edu in /pub/usenet/.......(the same
    thing as above.)

    Have fun, I hope this helps,

 < Haven't checked this one out yet but will in the future. I thought >
 < that this would just add more goo to the current pot and decided not >
 < to look at it yet - which of course means that this will solve all >
 < my problems, plus world hunger, plus ... You get the idea! >

And

    We've been running a LaserJetIIIsi in duplex mode with PostScript
    for several months. As I recall, all we did was configure it as
    the default mode from the front panel. You can force simplex mode
    with a few PostScript commands embedded in a job.

 < Thanks but this is the exact opposite of what we want, i.e., we just >
 < wanted to embed a few PostScript commands in a job... >

And (last but not least)

    I wrote this filtering script named 'tray' for adding the proper
    PostScript tray and duplex-changing bits from the command line.
    Enjoy.

 < Good reference for the options that I needed to set - I didn't have >
 < to go look up any options - they were all here! BTW Brian, we >
 < haven't played with the resolution-enhancing modes. >

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

So, we stuck to it and produced the following filter. We also modified
the psint.sh file (this is the ps?f filters) to move setting the comm
variable into the .options file. Now we have one .options file that
cases $PRINTER (retrieved from the current working directory) and set the
comm variable to whatever needs to be done.

We currently have this working with the Milan Fastport box on both the
serial and parallel ports as well as if the printer is on a tty port.

So, since we only have postscript printers, the if filter is always psif.
The approprate change to the psint.sh is as follows:

diff -c psint.sh /usr/local/print/ps/lib/psif
*** psint.sh Thu Sep 10 10:30:51 1992
--- /usr/local/print/ps/lib/psif Fri Sep 11 14:21:11 1992
***************
*** 64,70 ****
  # vf - raster, df - TeX DVI, cf - cifplot, rf - fortran
  
  prog=`basename $prog`
! comm="$PSCOMM -P $pname -p $prog -n $user -h $host $afile"
  
  case $prog in
        psif) exec $comm ;;
--- 64,70 ----
  # vf - raster, df - TeX DVI, cf - cifplot, rf - fortran
  
  prog=`basename $prog`
! comm=${comm:-"$PSCOMM -P $pname -p $prog -n $user -h $host $afile"}
  
  case $prog in
        psif) exec $comm ;;

The .options file looks like this:

For a printer connected to a tty port:

        BANNERLAST=0 # Turn off banner at end
        BANNERFIRST=1 # Turn on banner at beginning
        REVERSE= # Turn off software page reversal (Suns)
        VERBOSE=0 # Turn off verbose log
        # DEBUG=1

This makes comm be unset so we get the default PSCOMM setting

For a printer on the Milan box:

        BANNERLAST=0 # Turn off banner at end
        BANNERFIRST=1 # Turn on banner at beginning
        REVERSE= # Turn off software page reversal (Suns)
        VERBOSE=0 # Turn off verbose log
        # DEBUG=1
        comm=/usr/local/print/milan/pspardfilter

and the reason for all this mail (an HP IIIsi running in duplex mode off of
the serial port on the milan box:

        REVERSE= # Turn off software page reversal (AppleTalk)
        VERBOSE=1 # Turn on verbose log (default)
        BANNERLAST=0 # Turn off banner at end
        BANNERFIRST=1 # Turn on banner at start
        comm="/usr/local/print/hp/ps/HP-duplex \
                                /usr/local/print/milan/psserdfilter -P dcs_hp1"

*** Note the backslash on the comm= line - stupid mailers argh!

Finally, here is the HP-duplex script - this is the beast that embeds the
appropriate commands into the job stream:

#!/bin/sh

# HP-duplex
# =========
#
# Master duplex filter used to print a job on HP LaserJet IIIsi
# printers in duplex mode

PSLIBDIR=${PSLIBDIR:-/usr/local/print/ps/lib}
export PSLIBDIR

if [ $# = 0 ]
then
        echo "$0: usage $0 'comm filter and arguments'" >&2
else
        comm="$@"
fi

###########################################################
# Send the printer control postscript program(s)
###########################################################
#
{
        #
        # Send the file
        #
        read firstline

        case $firstline in
                %!* ) # the file is already PostScript add duplexing lines
                        echo $firstline
                        echo '%%HP LaserJet Kludge'
                        echo 'statusdict begin true setduplexmode end'
                        echo 'statusdict begin false settumble end'
                        cat
                        break
                        ;;
                *) # the file is a text file, so convert it to PostScript
                        echo '%!'
                        echo '%%HP LaserJet Kludge'
                        echo 'statusdict begin true setduplexmode end'
                        echo 'statusdict begin false settumble end'
                        (echo $firstline ; cat ) | $PSLIBDIR/pstext
        esac

        #
        # turn off duplex
        #
        echo "statusdict begin false setduplexmode end"

} | eval $comm

exit 0
#==========================================

We ended up with a solution that is postscript/transcript based but this stuff
should work OK with the .param file for NewsPrint with only minor changes. We
did not test it and make no guarantees - of course!

Thanks for all the help - hope this helps someone else!

-dan

-- 
Dan Transue                    |Realmail:       odt@dcs.bellcore.com
Bellcore                       |FakeMail:       bellcore!dcs!odt
6 Corporate Place room 1J-257  |VoiceMail:      (908) 699-5223
Piscataway, NJ 08854



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:49 CDT