on Thu, Aug 30, 2001 at 07:34:17AM +0200, Erdmut Pfeifer ([EMAIL PROTECTED]) 
wrote:
> On Wed, Aug 29, 2001 at 04:32:30PM -0700, Karsten M. Self wrote:
> > Another PITA:
> > 
> > I've got a Hewlett Packard LaserJet 4 Printer, it's got a primary and
> > manual feed tray.  Question is:  how do I indicate a job's supposed to
> > go to the manual-feed tray?
> > 
> > I suspect it's a PCL issue.
> 
> if it's a non-postscript printer, yes.

Actually, it's got a Postcript card in it ;-)

> > I've found a page with a list of codes that looks promising:
> > 
> >     http://www.hp.com/cposupport/printers/support_doc/bpl02705.html
> 
> (thanks for the pointer, BTW.  Good to know there exists such a page.
> At the moment I don't really need the info -- but who knows when the
> time comes ;)
> 
> > ...but hell if I know how to apply them.
> > 
> > I'm using lpr.  I remember some stuff from way back when I ran on HPUX
> > that we'd throw a slew of options at the printer with jobs for various
> > output options (usually portrait/landscape orientation).  I'm hoping
> > that I can do something here either with a '-o' option or with a
> > printcap configuration.
> 
> If I were in the situation, I'd start my first experiments by cat-ing
> the stuff directly to the printer device to avoid having to deal with
> the lpr system at this stage of experimentation.
> 
> I'd write myself a little script to ease transferring the information
> from the above webpage to my printer. It could look something like:
> 
> #!/usr/bin/perl
> 
> my $manual_feed = pack "H*", join "", qw(1B 26 6C 32 48);
> 
>    # $manual_feed now is a 5-byte binary string representing the
>    # PCL escape/control sequence for "manual feed"
> 
> print $manual_feed, <>;

...it's a networked printer.  Which means that it's a bit difficult to
just send it bits.  Though I can play with that.  I've found that
printing text from the command line doesn't work too well.

> This does nothing more than assembling the escape sequence specified in
> hex notation (as found in the last column of the table on the webpage)
> into the (binary) string that needs to be sent to the printer. This
> string is then simply prepended to the data to be printed. The script
> can be used as a pipe or be called with argument(s) representing the
> files to be sent to the printer. It's meant as an example only -- with
> a hardcoded PCL sequence for selecting the manual-feed paper option.
> (The idea is just to make it easy to cut & paste the sequences form the
> webpage without too much editing...)
> 
> Once you have the PCL sequences causing the desired effects in the
> printer, you could proceed to the next step, which would be the
> question how to integrate that into the lpr system.
> 
> Basically, I'd try to use printcap's facility to specify filters. In
> this particular case it wouldn't matter much whether you use the 'if'
> or the 'of' filter (though, if you already have a filter configured,
> you'd somehow have to chain/merge their effects, of course, e.g. by
> making one filter a wrapper for the other...). Also, IIRC, the 'of'
> filter will only get called when there's no 'if' filter -- see the
> manpage for details.

I've also since discovered the ifhp package, which appears to be
designed to do pretty much what I'm asking for here, though there's
rather little guidance provided on how it's supposed to be used.
Printing in general's always been more or less a mystery to me.
Printing is in $STATE, I mess with configurations, and eventually
printer is in ( $STATE - 1 )**2.

...I did get sufficiently frustrated with the printcap(5) manpage that I
reformatted it for much better readability, however, and submitted it to
the package maintainer, so that might make its way into a future
release.  (Re)learned a bit about groff, troff, and groff_man macros to
boot.

> Also, more generally, the whole approach of simply *prepending* some
> PCL escape sequences would not be able to deal with data already
> containing conflicting PCL code, as might be generated by some
> applications. For example, if an application insists on generating
> PCL code to select tray-1, this would simply override any attempts to
> select manual-feed, etc., as the 'tray-1' code appears later in the
> stream sent to the printer...
> 
> Anyhow, these are just a few thoughts -- I haven't actually tried
> anything of this :)

Thanks, food for thought.

-- 
Karsten M. Self <kmself@ix.netcom.com>          http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?             There is no K5 cabal
  http://gestalt-system.sourceforge.net/               http://www.kuro5hin.org
   Free Dmitry! Boycott Adobe! Repeal the DMCA!    http://www.freesklyarov.org
Geek for Hire                        http://kmself.home.netcom.com/resume.html

Attachment: pgp4Oti8iy69r.pgp
Description: PGP signature

Reply via email to