It is possible to add PJL (HP Printer Job Language) code to a job using the boj command, defining the entire escape and PJL sequence. This is then added to the job by UnForm. A simple example:
boj "<27>%-12345X@PJL<10>@PJL JOB NAME=<34>Title Of Job<34><10>@PJL ENTER LANGUAGE=PCL<10>"
eoj "<27>%-12345X@PJL<10>@PJL EOJ<10><27>%12345X"
Note the use of <27>, <34>, and <10> for the escape, quote, and linefeed characters, respectively. PJL commands vary by printer, so refer to your printers technical documentation for specific features.
You can also use expressions, so it is possible to adjust control dynamically. In the below sample, a hypothetical staple command is defined based on page content, then used in a bop command as an expression:
prepage{
# end_of_document set to 1 on last page of each doc...
pjl$=chr(27)+"%-12345X@PJL"+chr(10)
if end_of_document then pjl$+="@PJL SET FINISH=STAPLE" else pjl$+="@PJL SET FINISH=NONE"
pjl$+=chr(10)+"@PJL ENTER LANGUAGE=PCL"+chr(10)
}
bop {pjl$}
If the whole job is to be stapled together, the code might look like this:
prejob {
# setup string to send to printer
pjl$ =chr(27)+"%-12345X@PJL"+chr(10)
pjl$+="@PJL SET PROCESSINGTYPE=STAPLING"+chr(10)
pjl$+="@PJL SET PROCESSINGOPTION=ONE_STAPLE"+chr(10)
pjl$+="@PJL ENTER LANGUAGE=PCL"+chr(10)
}
boj {pjl$}
Kyocera code
The following stapling PJL code was provided by a customer for a Kyocera printer.
prejob {
# kyocera
pjl$=chr(27)+"%-12345X"
pjl$+="@PJL SET OUTBIN=OPTIONFACEDOWN"+chr(10)
pjl$+="@PJL SET STAPLEOPTION=ONE"+chr(10)
pjl$+="@PJL SET FINISH=STAPLE"+chr(10)
pjl$+="@PJL ENTER LANGUAGE=PCL"+chr(10)
}