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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specify tray in PCL file 1

Status
Not open for further replies.

surge19

Programmer
Mar 28, 2006
6
US
We will be generating PCL files made by an HP Laser Jet 4 driver.

We need to print these files later by using copy or LPR command line utilities, but we need to specify the tray.

If I try to insert the escape command for a different tray anywhere in the header shown below, it will print from that tray but everything will be garbled.

How can I programmatically specify the tray?


<actual file snippet>

E&l0A&l0s0O&k0G(8U(s10.00h12.00v0p0s0b3TE&l0O&a0P&l1C&l0008E&l001C&l0512F&a0R&l008C&l02A&l1C&l0008E&l001C&l0512F&a0R&l008C&l0S*c1d4F)s213W @    '  x –   GOTHIC PMFUSER


<disassembled file with dumppcl.exe>

; Disassembly of <g:\split2.prn>
<Esc>E Reset
<Esc>&l0A Page size = 0
<Esc>&l0s Simplex print
0O Portrait
<Esc>&k0G CR -> CR, LF -> LF, FF -> FF
<Esc>(8U Primary symbol set = Roman8
<Esc>(s10.00h Primary font pitch = 10.00 chars per inch
12.00v Primary font height = 12.00 1/72 inch
0p Primary font spacing, fixed
0s Primary font style = Upright, solid
0b Primary font stroke weight = 0
3T Primary typeface = Courier
<Esc>E Reset
<Esc>&l0O Portrait
<Esc>&a0P Print rotation 0 (degrees, counterclockwise)
<Esc>&l1C Vertical motion index = 1 1/48 inch
<Esc>&l0008E Top margin = 0008 lines
<Esc>&l001C Vertical motion index = 001 1/48 inch
<Esc>&l0512F Text length = 0512 lines
<Esc>&a0R Vertical position = 0 rows
<Esc>&l008C Vertical motion index = 008 1/48 inch
<Esc>&l02A Page size = 02
<Esc>&l1C Vertical motion index = 1 1/48 inch
<Esc>&l0008E Top margin = 0008 lines
<Esc>&l001C Vertical motion index = 001 1/48 inch
<Esc>&l0512F Text length = 0512 lines
<Esc>&a0R Vertical position = 0 rows
<Esc>&l008C Vertical motion index = 008 1/48 inch
<Esc>&l0S Simplex print
<Esc>*c1d Assign font ID = 1
4F Make soft font temporary (last ID specified)
<Esc>)s213W Download soft font header descriptor of 213 bytes
0 1 2 3 4 5 6 7 - 8 9 A B C D E F 0123456789ABCDEF
0000 00 40 00 02 00 00 00 1E - 00 1A 00 27 00 01 00 20 .@.......'..
0010 00 78 00 96 00 00 00 00 - 03 00 00 00 00 00 20 02 .x.–......... 
0020 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0030 47 4F 54 48 49 43 20 20 - 20 20 20 20 20 20 20 20 GOTHIC
0040 20 20 20 20 20 20 20 20 - 50 4D 46 55 53 45 52 20 PMFUSER
0050 20 31 39 39 32 2F 30 37 - 2F 31 34 20 31 32 3A 31 1992/07/14 12:1
0060 37 20 43 30 44 30 47 42 - 31 32 20 31 39 39 32 2F 7 C0D0GB12 1992/
0070 30 37 2F 31 33 20 31 35 - 3A 30 36 20 43 31 44 30 07/13 15:06 C1D0
0080 47 42 31 32 20 20 20 20 - 20 20 20 20 20 20 20 20 GB12
0090 20 20 20 20 20 20 20 20 - 20 20 20 20 20 20 20 20
00A0 20 20 20 20 20 20 20 20 - 20 20 20 20 20 20 20 20
00B0 20 20 20 20 20 20 20 20 - 20 20 20 20 20 20 20 20
00C0 20 20 20 20 20 20 20 20 - 20 20 20 20 20 20 20 20
00D0 20 20 20 20 20 -
<Esc>*c129E Soft font character code = 129
<Esc>(s8..............
 
As long as the tray select command arrives at the printer before any printable data, it should work just fine. There must be some explanation of why the data is being corrupted.

What do you mean by garbled? You would have to be careful that your command wasn't in the middle of a font or image download. One thought, how are you inserting the tray command? Are you on UNIX? Maybe your editing process is corrupting the file. The VI editor will strip 0x00 chars from the file. Not a problem on a text file, but devastating to binary data such as a font.

Usually the biggest worry when specifying a tray is what will happen if that specific tray is empty and there is another with a suitably sized paper.

Jim Asman
 
That must be the problem- I was using Notepad, I'll try it in binary mode.

You sound like someone who could shed some light on my next PCL question, how to make a PCL pagesplitter, which I'll post separately from this...

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top