Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get paper size from PCL6 1

Status
Not open for further replies.

JeremySA

Programmer
Dec 29, 2004
11
ZA
Hi please i need help

i am new at pcl xl i am trying to get the paper size from pcl xl but i dont understand how pcl5 was easy but pcl 6 is completely different, i have seen a couple of post of output files but i dont know how they get there valuse and all i want is the paper size for a in house app.

with this pcl6 could some on please tell me how to just get my paper size

%-12345X@PJL COMMENT Minolta Di2510f PCL6 8.32
@PJL JOB NAME="Microsoft Word - Document1"
@PJL SET DUPLEX=OFF
@PJL SET OUTBIN=DEFAULT
@PJL SET SORTING=NONE
@PJL SET RET=OFF
@PJL SET ECONOMODE=OFF
@PJL SET USERNAME=""
@PJL SET JOBPRIORITY=3
@PJL ENTER LANGUAGE=PCLXL
) HP-PCL XL;2;0;Comment Granite Systems, Inc 1998-2002 (W2K 8.32, 8.32)
?XX?? ???A? ???H?? Plain?'? ?(??%??&C??jt? { ?*u?????????+w? ?S? kr?Bh??j? ? c???,{?? TimesNewRmn ??U??B??u?o?bR?Lk?? dfdasdfsfsdffs??? 1 1+&0 & &1! ??R?Lk?? fsfd??? & ?? R?Lk?? ??? ?? ?1DIB%-12345X@PJL EOJ
%-12345X

thank you
 
sorry this is what it looks like

<p>%-12345X@PJL COMMENT Minolta Di2510f PCL6 8.32
@PJL JOB NAME="Microsoft Word - Document1"
@PJL SET DUPLEX=OFF
@PJL SET OUTBIN=DEFAULT
@PJL SET SORTING=NONE
@PJL SET RET=OFF
@PJL SET ECONOMODE=OFF
@PJL SET USERNAME=""
@PJL SET JOBPRIORITY=3
@PJL ENTER LANGUAGE=PCLXL
) HP-PCL XL;2;0;Comment Granite Systems, Inc 1998-2002 (W2K 8.32, 8.32)
?XX?? ???A? ???H?? Plain?'? ?(??%??&C??jt? { ?*u?????????+w? ?S? kr?Bh??j? ? c???,{?? TimesNewRmn ??U??B??u?o?bR?Lk?? dfdasdfsfsdffs??? 1 1+&0 & &1! ??R?Lk?? fsfd??? & ?? R?Lk?? ??? ?? ?1DIB%-12345X@PJL EOJ
%-12345X</p>
 
The paper (media) size is almost certainly an enumerated value (which I can't tell from your post) preceding the '%' character in the first of the lines following that which contains 'HP_PCL XL;'.

Examples of the enumerated values (as hexadecimal values) are:

0x00 eLetterPaper
0x01 eLegalPaper
0x02 eA4Paper
0x03 eExecPaper
0x04 eLedgerPaper
0x05 eA3Paper

To interpret it properly, I would need to see the above as a stream of hexadecimal characters.

If you send a copy of your print stream, as a file attachment, to 'D_a_n_s_D_a_d_@ b t i n t e r n e t . c o m' (remove the underscores and spaces), I can interpret it for you more fully. Bear in mind that this mailbox gets a lot of spam, and I don't check it every day.

 
thanks DansdadUK i have mailed the attachment, thanks for helping me i really appreciate it thanks, i just need to know how to decipher it or if you could just put me in the right direction thanks
 
Jeremy

Your job is selecting a media size of A3; see attached analysis:

Code:
*** PCL Analysis ***

Date/Time:  2004/12/30 09:02:57
File:       E:\Gandlake\DataFiles\Temp\00015.SPL
Size:       627 bytes
Analysis:   151 rows (excluding header and trailer lines)

Offset(dec)  Type                   Sequence          Data / Interpretation
¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
0000000000  Special                <Esc>%-12345X     Universal Exit Language (UEL)
            Comment                                  Switch language to PJL
0000000009  PJL Command                              @PJL COMMENT Minolta Di2510f PCL6 8.32[0d][0a]
0000000049  PJL Command                              @PJL JOB NAME="Microsoft Word - Document1"[0d][0a]
0000000093  PJL Command                              @PJL SET DUPLEX=OFF[0d][0a]
0000000114  PJL Command                              @PJL SET OUTBIN=DEFAULT[0d][0a]
0000000139  PJL Command                              @PJL SET SORTING=NONE[0d][0a]
0000000162  PJL Command                              @PJL SET RET=OFF[0d][0a]
0000000180  PJL Command                              @PJL SET ECONOMODE=OFF[0d][0a]
0000000204  PJL Command                              @PJL SET USERNAME=""[0d][0a]
0000000226  PJL Command                              @PJL SET JOBPRIORITY=3[0d][0a]
0000000250  PJL Command                              @PJL ENTER LANGUAGE=PCLXL[0d][0a]
            Comment                                  Switch language to PCLXL (PCL6)
0000000277  PCLXL Stream Header    0x292048..        ") HP-PCL XL;2;0;Comment Granite Systems, Inc 199"
0000000325                         0x382d32..        "8-2002 (W2K 8.32, 8.32)[0a]"
0000000349  PCLXL Data Type        0xd1                  uint16_xy
0000000350             Value       0x58025802            600 600
0000000354  PCLXL Attribute        0xf889              UnitsPerMeasure
0000000356  PCLXL Data Type        0xc0                  ubyte
0000000357             Value       0x00                  eInch
0000000358  PCLXL Attribute        0xf886              Measure
0000000360  PCLXL Data Type        0xc0                  ubyte
0000000361             Value       0x02                  eErrorPage
0000000362  PCLXL Attribute        0xf88f              ErrorReport
0000000364  PCLXL Operator         0x41              BeginSession
                           No.                       1
0000000365  PCLXL Data Type        0xc0                  ubyte
0000000366             Value       0x00                  eDefaultDataSource
0000000367  PCLXL Attribute        0xf888              SourceType
0000000369  PCLXL Data Type        0xc0                  ubyte
0000000370             Value       0x01                  eBinaryLowByteFirst
0000000371  PCLXL Attribute        0xf882              DataOrg
0000000373  PCLXL Operator         0x48              OpenDataSource
                           No.                       2
0000000374  PCLXL Data Type        0xc8c10500            ubyte_array
0000000378             Value       0x506c61..            "Plain"
0000000383  PCLXL Attribute        0xf827              MediaType
0000000385  PCLXL Data Type        0xc0                  ubyte
0000000386             Value       0x00                  ePortraitOrientation
0000000387  PCLXL Attribute        0xf828              Orientation
0000000389  PCLXL Data Type        0xc0                  ubyte
0000000390             Value       0x05                  eA3Paper
0000000391  PCLXL Attribute        0xf825              MediaSize
0000000393  PCLXL Data Type        0xc0                  ubyte
0000000394             Value       0x01                  eAutoSelect
0000000395  PCLXL Attribute        0xf826              MediaSource
0000000397  PCLXL Operator         0x43              BeginPage
                           No.                       3
0000000398  PCLXL Data Type        0xc0                  ubyte
0000000399             Value       0x01                  eGray
0000000400  PCLXL Attribute        0xf803              ColorSpace
0000000402  PCLXL Operator         0x6a              SetColorSpace
                           No.                       4
0000000403  PCLXL Operator         0x74              SetPageDefaultCTM
                           No.                       5
0000000404  PCLXL Data Type        0xd3                  sint16_xy
0000000405             Value       0x88007b00            136 123
0000000409  PCLXL Attribute        0xf82a              PageOrigin
0000000411  PCLXL Operator         0x75              SetPageOrigin
                           No.                       6
0000000412  PCLXL Data Type        0xd5                  real32_xy
0000000413             Value       0xa2b2b6..            1.427326 1.427326
0000000421  PCLXL Attribute        0xf82b              PageScale
0000000423  PCLXL Operator         0x77              SetPageScale
                           No.                       7
0000000424  PCLXL Data Type        0xc0                  ubyte
0000000425             Value       0x00                  eInterior
0000000426  PCLXL Attribute        0xf853              ClipRegion
0000000428  PCLXL Data Type        0xe3                  sint16_box
0000000429             Value       0x000000..            0 0 4715 6770
0000000437  PCLXL Attribute        0xf842              BoundingBox
0000000439  PCLXL Operator         0x68              SetClipRectangle
                           No.                       8
0000000440  PCLXL Data Type        0xc0                  ubyte
0000000441             Value       0x01                  eGray
0000000442  PCLXL Attribute        0xf803              ColorSpace
0000000444  PCLXL Operator         0x6a              SetColorSpace
                           No.                       9
0000000445  PCLXL Data Type        0xc0                  ubyte
0000000446             Value       0x00                  0
0000000447  PCLXL Attribute        0xf809              GrayLevel
0000000449  PCLXL Operator         0x63              SetBrushSource
                           No.                       10
0000000450  PCLXL Data Type        0xc0                  ubyte
0000000451             Value       0xfc                  e_PSo
0000000452  PCLXL Attribute        0xf82c              ROP3
0000000454  PCLXL Operator         0x7b              SetROP
                           No.                       11
0000000455  PCLXL Data Type        0xc8c11000            ubyte_array
0000000459             Value       0x54696d..            "TimesNewRmn     "
0000000475  PCLXL Attribute        0xf8a8              FontName
0000000477  PCLXL Data Type        0xc5                  real32
0000000478             Value       0x55d5c342            97.916664
0000000482  PCLXL Attribute        0xf8a6              CharSize
0000000484  PCLXL Data Type        0xc1                  uint16
0000000485             Value       0x7502                629
0000000487  PCLXL Attribute        0xf8aa              SymbolSet
0000000489  PCLXL Operator         0x6f              SetFont
                           No.                       12
0000000490  PCLXL Data Type        0xd3                  sint16_xy
0000000491             Value       0x62025203            610 850
0000000495  PCLXL Attribute        0xf84c              Point
0000000497  PCLXL Operator         0x6b              SetCursor
                           No.                       13
0000000498  PCLXL Data Type        0xc8c10e00            ubyte_array
0000000502             Value       0x646664..            "dfdasdfsfsdffs"
0000000516  PCLXL Attribute        0xf8ab              TextData
0000000518  PCLXL Data Type        0xc8c10e00            ubyte_array
0000000522             Value       0x312031..            ( 49 32 49 43 38 48 32 38 32 38 49 33 32 0 )
0000000536  PCLXL Attribute        0xf8af              XSpacingData
0000000538  PCLXL Operator         0xa8              Text
                           No.                       14
0000000539  PCLXL Data Type        0xd3                  sint16_xy
0000000540             Value       0x89045203            1161 850
0000000544  PCLXL Attribute        0xf84c              Point
0000000546  PCLXL Operator         0x6b              SetCursor
                           No.                       15
0000000547  PCLXL Data Type        0xc8c10400            ubyte_array
0000000551             Value       0x66736664            "fsfd"
0000000555  PCLXL Attribute        0xf8ab              TextData
0000000557  PCLXL Data Type        0xc8c10400            ubyte_array
0000000561             Value       0x20262000            ( 32 38 32 0 )
0000000565  PCLXL Attribute        0xf8af              XSpacingData
0000000567  PCLXL Operator         0xa8              Text
                           No.                       16
0000000568  PCLXL Data Type        0xd3                  sint16_xy
0000000569             Value       0x20055203            1312 850
0000000573  PCLXL Attribute        0xf84c              Point
0000000575  PCLXL Operator         0x6b              SetCursor
                           No.                       17
0000000576  PCLXL Data Type        0xc8c10100            ubyte_array
0000000580             Value       0x20                  " "
0000000581  PCLXL Attribute        0xf8ab              TextData
0000000583  PCLXL Data Type        0xc8c10100            ubyte_array
0000000587             Value       0x00                  ( 0 )
0000000588  PCLXL Attribute        0xf8af              XSpacingData
0000000590  PCLXL Operator         0xa8              Text
                           No.                       18
0000000591  PCLXL Data Type        0xc1                  uint16
0000000592             Value       0x0100                1
0000000594  PCLXL Attribute        0xf831              PageCopies
0000000596  PCLXL Operator         0x44              EndPage
                           No.                       19
0000000597  PCLXL Operator         0x49              CloseDataSource
                           No.                       20
0000000598  PCLXL Operator         0x42              EndSession
                           No.                       21
0000000599  Special                <Esc>%-12345X     Universal Exit Language (UEL)
            Comment                                  Switch language to PJL
0000000608  PJL Command                              @PJL EOJ[0d][0a]
0000000618  Special                <Esc>%-12345X     Universal Exit Language (UEL)

*** End of analysis ***
 
thats right but how do you do that, i saw one off your other postings where you say a to use the hexworkshop editor to see where your offsets are but i see the hex value, and found the enum for my paper sizes but i dont know how to get there
 
what i actually mean is how do you get the structure to this format that you have, how do you take the print stream and break it up into the structure that you have from the hexworkshop editor
 
In order to parse a PCL XL print stream, you would need a knowledge of the language structure. A description of that is much too compliated to put in a reply here.

HP used to provide access to various PCL5 and PCL6 documents (including a 'PCL XL Reference') via the HP Developer Association ( where you could join as an affiliate (I think that's the term) for free.

But they now seem to have cut off that avenue; you can now apparently only join if you present a 'business case' (and previous affiliates like myself no longer have access).

So I'm not sure where you could now get the details; start badgering HP to provide a supported document set (as they still apparently do for PCL5)?
 
thanks ill do that but i have been playing around and seem to more or less get it now, but ill bother hp for documentation

thanks again for your help
 
Jeremy

A very simple overview of PCL XL:

PCLXL is a stack-based post—fix (cf PostScript), object oriented, protocol, but using a binary (rather than ASCII) binding.

The unit of work in PCLXL is called a stream; the main (parent) stream may reference and execute previously stored user-defined streams.

Each stream consists of a stream header and a stream body; the body defines one or more sessions, each of which contains one or more page descriptions.

The stream header defines the binding (Little-Endian or Big-Endian), and the protocol class and protocol revision levels relevant to the stream body.

The stream body is composed of operators, which are themselves each (optionally) preceded by an attribute list, which consists of one or more attribute value/identifier pairs.

The attribute value is represented using a datatype object, which precedes the attribute identifier which it qualifies.

Each session is bounded by BeginSession and EndSession operators.

Note that switching a device to the PCLXL language can only be invoked through the @PJL ENTER LANGUAGE command; hence a simple job will consist of the following parts:

<Esc>%12345
@PJL ENTER LANGUAGE = PCLXL<CR><LF>
<PCLXL stream header>
begin session …
… page 1 …

… page n …
end session …
<Esc>%12345

Hope this helps.
 
DandadUK
yes thanks that helps i now understand the structure now and from you previous posts i understand about the "begin session" and "opendatasource" etc, but one last question what actually seperates the opertaors what hexidecimal character seperates them cause if i can know that i might have my problem completely solved

thanks
 
Nothing 'separates' the operators; each operator is merely the character following a 'set' of attributes; you can only find each operator by parsing the stream (analysing the structure) from the beginning.
 
so what you saying is that you use your decimal offset in you stream to decipher the hex values at a specific position if thats true then im am done,

and i just want to say thanks for the fast replys it really helps THANKS
 
The offset values shown in the analysis are merely the byte offsets within the supplied print file.

This is useful if (after viewing the analysis) you want to modify the print file (to change some value), as you can (within a suitable hexadecimal editor) easily go to the required point in the file using the appropriate offset.
 
What I'd like to know is what DansDadUK used to generate the PCL XL dump. I have a tool from HP that doesn't do that great of a job and I'm looking for something better.
 
The PCL Analyser is based on one I wrote in 1997 to run on an ICL VME mainframe; I rewrote it as a Windows-based application in 2002 (and have updated it with improvements since then).

However, it is not, at present, available externally; it is only available for use internally within the company I work for (see
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top