-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Printers Archive
- Re: Sending PCL to Laserjet to add job information

Create an account on the HP Community to personalize your profile and ask a question

03-02-2015 07:25 AM
Hi,
I'm trying to add job information to a printout by adding a PJL header, however none of the parameters I add seem to have any effect.
Can you provide me with a working sample pjl that sets the job attributes ? specically username/id and job description .
Details
I'm using a CP2025 to test.
I currenly use linux nc (netcat) to send the file to the printer .
[root@hostname pjl]# cat pjljob.txt barcode_with_sample.ps | nc -v -v xxx.xxx.xxx.xxx 9100
Connection to xxx.xxx.xxx.xxx 9100 port [tcp/jetdirect] succeeded!
2345X[root@hostname pjl]#
- my sample page gets printed, but
- only one copy ,
- the status display is unchanged
- none of the user id settings have any effect
- some of the pjl file (2345X) is shown in the terminal
The job status page http://XXX.XXX.XXX.XXX/hp/device/info_colorUsageJobLog.html?tab=Status&menu=ColorUsageLog does not show any of the parameters I sent. Date/Time , User, Job and Application are empty; Mono Sides, Color Sides and Total Sheets are correct
^[%-12345X@PJL JOB NAME="first job name"
@PJL RDYMSG DISPLAY="My status"
@PJL SET HOSTLOGINNAME="host logon"
@PJL SET USERID="userid"
@PJL SET JOBNAME="PJL test page"
@PJL SET QTY=2
@PJL SET USERID="007"
@PJL SET TIME="11:55:00"
@PJL SET DATE="2014/12/31"
@PJL ENTER LANGUAGE = POSTSCRIPT
^[%-12345X
Solved! Go to Solution.
Accepted Solutions
03-03-2015 04:23 AM
>> ^[ is an escape character
No, it is not; it is a common representation of the non-graphic control-code Escape character, as used by utilities in the *n*x world.
Control-code 'characters' have no glyph (shape); the Escape control-code is commonly shown as <Esc> in documentation.
As far as I know, the most common C0 control-code characters all have ctrl-x representations understood by those utilities; e.g.:
ctrl-M represents the Carriage Return control-code (0x0D)
ctrl-L represents the Line Feed control-code (0x0A)
ctrl-[ represents the Escape control-code (0x1B)
>> Do you mean I need a pjstart.txt + output.ps + pjlend.txt ?
Ideally, yes.
>> ... result by removing the ESC%-12345X at the end of my pjl file ...
Yes, this should not be there - it was the cause of some of your symptoms.
I don't know why I missed it before when I looked at your file (tiredness, plus concentrating on the UEL at the start of the file - lame excuse, I know!).
The effect of that UEL (<Esc>%-12345X) immediately after the @PJL ENTER LANGUAGE=POSTSCRIPT command was to reset the printer to its power-on (user-set) defaults (hence negating any temporary PJL settings), and to return the device to PJL mode.
The printer did then print your PostScript file, because your printer (in common with many similar devices) has an AUTO-personality setting, which means that it can determine (although not always with 100% reliability), through analysis of the first so many bytes of the stream, whether an incoming print job is likely to be PCL or PostScript, and hand control over to the appropriate Page Description Language interpreter.
>> Are the better tools to send this to a printer ?
I don't know (as I mentioned before, it's decades since I had much contact with *n*x systems).
03-02-2015 10:26 AM
>> ... some of the pjl file (2345X) is shown in the terminal ...
Not sure what you mean by "in the terminal"; are you referring to the "2345X[root@hostname pjl]#" prompt?.
If what you are trying to say is that "2345X" is being printed, then this implies that the escape sequence is invalid, probably because it does not start with an Escape character.
Can you confirm whether or not any part of the pjljob.txt file is printed (rather than being interpreted)?
The Escape character is the non-graphic control-code character with decimal code 27, or hexadecimal 1B or (archaic!) octal 033, and as represented by the ^[ placeholder in your description.
Your pjljob.txt file does start with the correct character, so perhaps the "cat ... | nc ..." mechanism is substituting some other character for the escape character? (I don't know - it's decades since I've dabbled in *n*x commands).
... and anyway (just for completeness), perhaps there ought to be @PJL EOJ and UEL to terminate the print job.
03-03-2015 01:56 AM
Hi Chris,
thanks for the reply,
> Not sure what you mean by "in the terminal"; are you referring to the "2345X[root@hostname pjl]#" prompt?.
Yes
^[ is an escape character
> ... and anyway (just for completeness), perhaps there ought to be @PJL EOJ and UEL to terminate the print job.
Do you mean I need a
pjstart.txt + output.ps + pjlend.txt ?
I got a first result by removing the ESC%-12345X at the end of my pjl file.
> I don't know - it's decades since I've dabbled in *n*x commands
Are the better tools to send this to a printer ?
03-03-2015 04:23 AM
>> ^[ is an escape character
No, it is not; it is a common representation of the non-graphic control-code Escape character, as used by utilities in the *n*x world.
Control-code 'characters' have no glyph (shape); the Escape control-code is commonly shown as <Esc> in documentation.
As far as I know, the most common C0 control-code characters all have ctrl-x representations understood by those utilities; e.g.:
ctrl-M represents the Carriage Return control-code (0x0D)
ctrl-L represents the Line Feed control-code (0x0A)
ctrl-[ represents the Escape control-code (0x1B)
>> Do you mean I need a pjstart.txt + output.ps + pjlend.txt ?
Ideally, yes.
>> ... result by removing the ESC%-12345X at the end of my pjl file ...
Yes, this should not be there - it was the cause of some of your symptoms.
I don't know why I missed it before when I looked at your file (tiredness, plus concentrating on the UEL at the start of the file - lame excuse, I know!).
The effect of that UEL (<Esc>%-12345X) immediately after the @PJL ENTER LANGUAGE=POSTSCRIPT command was to reset the printer to its power-on (user-set) defaults (hence negating any temporary PJL settings), and to return the device to PJL mode.
The printer did then print your PostScript file, because your printer (in common with many similar devices) has an AUTO-personality setting, which means that it can determine (although not always with 100% reliability), through analysis of the first so many bytes of the stream, whether an incoming print job is likely to be PCL or PostScript, and hand control over to the appropriate Page Description Language interpreter.
>> Are the better tools to send this to a printer ?
I don't know (as I mentioned before, it's decades since I had much contact with *n*x systems).
03-03-2015 10:01 AM
Hi Chris,
Thanks for your assistance, I'm now able to send a job to the printer that is protected by a pincode. It's based on a sample from HP docs .
I'm still not able to set the user and application fields shown in the print log. The username does appear on the printer display but not on the job log.
The most recent version of PJL documentation I found dates back to 2003. Are there more recent manuals ?
^[%-12345X@PJL
@PJL COMMENT **Give job a name**
@PJL SET JOBNAME = "Job_12345"
@PJL COMMENT **Specify a user name**
@PJL SET USERNAME = "Slim_Jim"
@PJL COMMENT **Set Quantity to Print**
@PJL SET QTY = 1
@PJL COMMENT **Specify Proof & Hold**
@PJL SET HOLD = PROOF
@PJL COMMENT **Specify private job**
@PJL SET HOLDTYPE = PRIVATE
@PJL SET HOLDKEY = "0246"
@PJL ENTER LANGUAGE = PCL
^[E . . . . Protected PCL Job for Slim_Jim . . . . ^[E
^[%-12345X@PJL
@PJL EOJ
^[%-12345X
03-04-2015 05:50 AM
Carl
>> I'm still not able to set the user and application fields shown in the print log.
>> The username does appear on the printer display but not on the job log.
The original PJL specification includes certain commands that can cause messages on the printer display panel to be updated; I'm not sure whether or not any commands are supposed to update logs held in the non-volatile memory of the printer. Bear in mind that the PJL specification predates the use & availability of such logs.
It is perhaps the case that some of these fields can be updated using Peripheral Management Language commands.
I don't know whether or not this is the case, and detailed information on PML is difficult to find.
The language itself uses a fairly simple Action | Outcome format (see the PML tags page of the Print Languages tool in the PCL Paraphernalia application (available via http://www.pclparaphernalia.eu - you'll need to install/run it on a .NET system).
Data is set or obtained via Object Identifiers (OIDs), so you'd need an appropriate MIB for the printer model to be able to interpet these values (although the generic Printers MIB will describe some of the entries).
An snmpwalk of the printer would return details of all the OIDs on the printer, but without a suitable MIB these would be uninterpreted.
Some printer drivers set simple values via PML, using @PJL DMINFO (or DMCMD?) ASCIIHEX envelopes; the only ones that I've seen appear to be just for the current date and time (in ISO standard format); for example:
<Esc>%-12345X @PJL SET RET=ON[0a] @PJL JOB NAME="abcde.txt - Notepad"[0a] @PJL SET STRINGCODESET=UTF8[0a] @PJL COMMENT "HP LJ300-400 color MFP M375-M475 PCL 6 (0.3.1553.12262); Windows 8 Pro 6.2.9200.1; Unidrv 0.3.9200.16451"[0a] @PJL COMMENT "Username: chris; App Filename: abcde.txt - Notepad; 2-25-2013"[0a] @PJL SET JOBATTR="JobAcct1=chris"[0a] @PJL SET JOBATTR="JobAcct2=CHRIS-2012"[0a] @PJL SET JOBATTR="JobAcct3=chris-2012"[0a] @PJL SET JOBATTR="JobAcct4=20130225153843"[0a] @PJL SET JOBATTR="JobAcct5=<redacted>"[0a] @PJL SET JOBATTR="JobAcct6=Notepad"[0a] @PJL SET JOBATTR="JobAcct7=NOTEPAD.EXE"[0a] @PJL SET JOBATTR="JobAcct8=chris"[0a] @PJL SET JOBATTR="JobAcct9="[0a] @PJL DMINFO ASCIIHEX="0400040101020D101001153230313330323235313533383433"[0a] >>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Comment Start analysis of embedded PML string Comment of size 50 ASCIIHEX characters (25 bytes) 01:0000000000 PML Request 0x04 SetRequest 01:0000000001 PML Data Type/Length 0x0004 Object Identifier / 4 01:0000000003 Value 0x0101020d 1.1.2.13 01:0000000007 PML Data Type/Length 0x1010 String / 16 01:0000000009 Symbol Set 0x0115 277 (= 8U) 01:0000000011 Value 0x323031.. 20130225153843 Comment End analysis of embedded PML string Comment of size 50 ASCIIHEX characters (25 bytes) <<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @PJL SET USERNAME="chris"[0a] @PJL SET JOBNAME="abcde.txt - Notepad"[0a] @PJL SET SEPARATORPAGE=OFF[0a] @PJL SET ECONOMODE=OFF[0a] @PJL SET KEEPGLOSSMODE=UNDEFINED[0a] @PJL SET RESOLUTION=600[0a] @PJL SET BITSPERPIXEL=8[0a] @PJL ENTER LANGUAGE=PCLXL[0a]
>> The most recent version of PJL documentation I found dates back to 2003. Are there more recent manuals ?
The PJL Technical Reference manual (and its Addendum) both appear to have been published in 2003; I'm not aware of any updates since then.
Chris
03-04-2015 08:04 AM
Hi Chris,
Thanks for the clear help, I managed to get the settings I wanted to add using the following header file.
<Esc>%-12345X@PJL JOB NAME="abcde.txt - Notepad"
@PJL SET JOBATTR="JobAcct1=Usernameinlog"
@PJL SET JOBATTR="JobAcct4=20150225115500"
@PJL SET JOBATTR="JobAcct6=My application"
@PJL SET USERNAME="chris"
@PJL ENTER LANGUAGE = POSTSCRIPT
Regards
Carl
