INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

programatically controlling the stapler

programatically controlling the stapler

(OP)
I'm trying to turn on the stapler for a print job and then reset it afterwards so future prints are not stapled.
I've spent months on this and need help.
Here's what I've got so far:
~%-12345X
@PJL SET OUTBIN=OPTIONALOUTBIN2
@PJL SET FINISH=STAPLE
@PJL SET STAPLEOPTION=ONEANGLED
@PJL ENTER LANGUAGE = PCL
~&l2A~&l1O
This is the report that I want to have stapled.
It could go on for several pages
bla bla bla
~%-12345X
@PJL SET OUTBIN=OPTIONALOUTBIN2
@PJL SET FINISH=NONE
@PJL SET STAPLEOPTION=NONE
~%-12345X~E

(Here, I'm showing ~ as the Escape character)

I'm using an HP M4555 MFP with the stapler option, and I've seen it work.
I get the report with just the text I expect (This is the report...), but with no staple, and it ends with the PJL code on the last page (where it has @PJL SET FINISH=NONE)

What am I doing wrong?

Thanks in advance!!

RE: programatically controlling the stapler

A PJL reference I found online uses a slightly different syntax, e.g.:
{
Ec%-12345X@PJL SET COPIES = 3 <CR> <LF>
@PJL SET RET = MEDIUM <CR> <LF>
@PJL SET PAGEPROTECT = OFF <CR> <LF>
@PJL ENTER LANGUAGE = PCL<CR> <LF>
EcE. . . .pcl job data. . . . .EcE
Ec%-12345X

}

There is a specific warning that there can be only <LF> and optionally <CR>
between the leading
Ec%-12345X
and the first @PJL sequence.
Beware of trailing spaces in the first line after Ec%-12345X ; stuff like that has bitten me many times.

The reference does not mention the trailing -E after the closing
Ec%-12345X
sequence.
Perhaps that is a newer enhancement.

No specific expertise claimed here.


RE: programatically controlling the stapler

According to the PJL Technical Reference manual:

The UEL command at the beginning of the job must be immediately followed by the PJL command prefix (@PJL).
No other characters, including control characters, are allowed between the UEL command and the @PJL prefix.


So the LineFeed characters following the 'X' of each of the Universal Exit Language sequences are technically invalid.

The <Esc>E escape sequence following the terminating UEL is also superfluous.

I've no idea whether or not the SET commands shown are valid for the target printer.

RE: programatically controlling the stapler

(OP)
Yes, that worked.
~%-12345X@PJL SET OUTBIN=OPTIONALOUTBIN2
@PJL SET FINISH=STAPLE
@PJL SET STAPLEOPTION=ONEANGLED
@PJL ENTER LANGUAGE = PCL
&l2A~&s1C....report goes here....
~E

and the next report is not stapled by default.
Thank you so much!!

RE: programatically controlling the stapler

(OP)
Now, when I print in Landscape, it doesn't staple at all.
I used PCL to go Landscape (~&l1O) but no staple.
I then tried to use PJL instead, but setting:
@PJL SET ORIENTATION=LANDSCAPE
it prints Landscape, but won't staple.
Is there another option I need to change at the same time?

~%-12345X@PJL JOB
@PJL SET OUTBIN = OPTIONALOUTBIN3
@PJL SET FINISH = STAPLE
@PJL SET ORIENTATION=LANDSCAPE
@PJL SET STAPLEOPTION = ONEANGLED
@PJL ENTER LANGUAGE = PCL
&l2A~&s1C . . . report . . .
~E ~%-12345X@PJL EOJ
@PJL RESET
~%-12345X

RE: programatically controlling the stapler

(OP)
Follow-up: if I change the STAPLEOPTION to:
@PJL SET STAPLEOPTION = ONE (instead of ONEANGLED)
it does staple, but puts it in the upper right corner instead of the left corner, and is still angled.
This is not a big problem, but wondered how to get it in the upper left.
Could you please point me to a PJL tech manual that has this stuff in it?
I found some on the internet that don't have these options (they were from the HPLJ 5SI era).
I'm very familiar with PCL, but PJL is new to me.

RE: programatically controlling the stapler

I don't think that HP has published any general PCL or PJL technical manuals since the early/mid 1990s.

I did find some documentation regarding PJL commands for Stapling and/or Hole Punching with LaserJet M806/M830/M855/M880 devices - the PJL commands are quite different to the ones you are using,though.

You may be able to find device-specific documentation for your device - I don't know.

RE: programatically controlling the stapler

(OP)
as a side note, would you happen to know how to access a Multi-function HP LaserJet printer's Faxing capability using PCL or PJL? I was hoping I could programmatically send a report to a printer, and use it's faxing capability to send it as a fax somewhere else, as our server has no dialing capability, but our MFP does.

RE: programatically controlling the stapler

>> ... would you happen to know how to access a Multi-function HP LaserJet printer's Faxing capability using PCL or PJL? ...

No idea, sorry.
I doubt that either of these 'languages' are anything to do with the faxing mechanism at all.

RE: programatically controlling the stapler

I don't know this multi-function printer, but the FAX function is probably accessed via a separate driver, not PCL or PJL.

RE: programatically controlling the stapler

Just a thought... you may want to set your paper orientation before the staple option... it could be that the staple option is getting reset when you change the orientation. <Shrugs>

Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

RE: programatically controlling the stapler

(OP)
Yes, I had thought of that, and it did make things better, but I think the problem might be that the printer can only staple in one fixed corner. Whether I print landscape, portrait or duplex, the staple is always in the same corner. But then, I haven't found a command to direct the printer to use a stapler in a different corner (if there is one)

RE: programatically controlling the stapler

And there may not be.... most of the staplers that I have seen (unless it's a saddle stapler) staples in one corner only. Rotating the page so that the upper-left corner of the printing is ejected physically closest to the stapler is all you can do in those cases.

Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

RE: programatically controlling the stapler

(OP)
is there a @PJL command to do that?

RE: programatically controlling the stapler

There is a "Reverse landscape" and "Reverse Portrait" that may do that... not sure... haven't played with PJL much.

https://support.necam.com/printers/pclcodes/pcl5hp...

Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

RE: programatically controlling the stapler

(OP)
Yes, it had an impact. It effectively staples on the bottom right corner now. For Landscape duplexed on the short edge, it is better than it was before. Not ideal, but better. But, Landscape duplexed on the long edge is bad. What I really need to do is print on the backs of the pages in reversed page order. I'm not sure if that is possible. I was really hoping the printer would be smart enough to figure it all out for me, and arrange the pages so that the stapler was where it is needed.

RE: programatically controlling the stapler

Don't forget in your settings to set:

@PJL SET FOLDSPINDLEMUTILATE = OFF
@PJL SET AUTOJAM = OFF

;)

Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

RE: programatically controlling the stapler

(OP)
Do you mean @PJL SET JAMRECOVERY = ON ??

RE: programatically controlling the stapler

>> ... I haven't found a command to direct the printer to use a stapler in a different corner (if there is one) ...

The parameters to the PJL SET command appear to vary from model to model, and there doesn't seem to be much in the way of documentation available (the old PJL Technical Reference manual and Addendum haven't been updated for years).

You may (on some devices) be able to find out what parameters are relevant for certain PJL variables, by using status read-back features.
For example, with a local LaserJet Enterprise M553x printer:



Note that, although it appears that the STAPLEOPTION variable is recognised, this particular printer does not have a stapler/stacker unit fitted, so the options are irrelevant - presumably the firmware supports the options for the situation where such a unit is fitted.

I've no idea whether or not your model would return the relevant data - you could try using the Status Readback tool in the PCL Paraphernalia application, available via http://www.pclparaphernalia.eu in order to find out.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close