Thanks Scott,

As always (or usual) you are right.
Since Canon says they support PCL and PJL I found that they
do BUT not exactly as HP developed it.

With Canon I actually had to use two PJL COMMENT commands to
get the stapler to work.
Where as with the HP printer we just used the HP PJL to turn
on the stapler.

I guess the Canon developers had some extra time to waste so
they do it differently rather then make there printers 100%
PCL and PJL compatible.

Anyways, I got it to work and thanks for you information


-----Original Message-----
From: Scott Klement [mailto:rpg400-l@xxxxxxxxxxxxxxxx]
Sent: Tuesday, August 26, 2008 12:41 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: How to turn on staple feature with RPG pgm

Hi John,

The controls for stapling and hole punching are not not
standardized --
different PJL commands for different printers.

Furthermore, it's often important to control WHERE the PJL
appear in the stream. In the case of stapling, you
sometimes need to
make sure the staple command is sent at the start of a
spooled file,
prior to the control sequences that start any of the pages.
The reason
being that the printer needs to know ahead of time that the
pages that
follow will be grouped together and stapled.

Personally, I prefer to use a user-defined transform program
(based on
IBM's TSPRWPR) since that lets me control the escape
sequences for the
whole document. Otherwise, HPT will insert the page-level
sequences for me, and consider my programs' data to be part
of the pages
-- and I don't have the opportunity to change the control
(unless you go *USERASCII -- but that's usually too much

Plus, if I use a USRTFMPGM I don't have to change any of my
code to insert control sequences into the spooled files --
since the
control sequences are inserted when the spooled file is
transformed, and
not when it's generated.

Also, I haven't worked with Canon printers -- but with some
models, I've found that there are certain PCL codes that
reset the hole
punching options (they may reset stapling as well, I can't
remember). I
think they were the page orientation codes? But my memory
is fuzzy. So
my transform program searches for those PCL commands and
removes them if
punching is turned on -- that way, the punching still works.

In my experience it takes a lot of trial and error to figure
out why
punching/stapling isn't working, because you have to find
the PCL codes
that are causing the problem :)

But the starting point is to get the documentation that
explains what
the correct PJL or PCL sequences are to enable stapling.
(Or, if you
can't get docs, try printing with a Windows driver and
sniffing the
network connection.) Then try inserting the PJL -- and
take it from there.

John Allen wrote:
I have used the staple feature on an HP4220 from within an
RPG program by sending PJL commands in the spooled file.

I tried the exact same sequence for a Canon ImageRunner
without success.

I cannot find any information using Google or Canon web
in regards to the commands

To send to activate stapler,

Anyone know anything about this or can point me to some



This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].