All PCL Command Sequences begin with the escape character (an ASCII control code with a hex value of 1Bh, 27 decimal) and end with the first upper case letter (or "=" note: "@" is considered an uppercase letter). In between there is either nothing (the PCL command is just the escape and a single upper case letter) or a set of one or two characters and often a numerical value. The single character commands are listed at the end of the "Decoded PCL Commands" table below. The first non-uppercase character after the escape will be a symbol between "!" and "\" (most commonly one of %,&,( or *) which is called the "parameter." After the parameter there is normally a lower case letter called the "group." After this there may be a numeric value. If no value is present, the value is assumed to be zero. Finally the ending uppercase letter is called the "command."
See Examples, Tutorials below for some samples of PCL commands and the Decoded Commands List for detailed information. Note that these use the text "Ec" to mean the escape character. Since the escape character is not printable, it is very hard to convey in human readable text. Common abreviations are Esc, Ec, [], or <-. See the ASCII page for more information on the codes. That page also allows you to convert between hex, decimal or ASCII codes. The form below can be used to find english descriptions of PCL commands. Just paste the PCL into the box, if you use "Ec" or "esc" to mean the escape character, press the "Ec and esc to escape" button, then press the "Decode PCL!" button.
ASCII control commands and HPGL (after PCL command to enter HPGL mode) are also acceptable in PCL 5. Printers that support PJL (Laserjet 4 and later) should be told to use PCL should be entered via the PJL ENTER LANGUAGE command.
Most of the problems people have with PCL are caused by not being aware of all the codes that are being sent to the printer and how they interact. Application programs, the language engine under the application, operating system printer drivers, network print que, and any number of other things will add codes to the print job before it reaches the printer and can cause the printer to behave in ways that are not expected. To understand why the printer prints as it does, you need to see what it saw.
There is a code that will allow you to see what is actually being recieved by the printer. Send esc&s0CescY to the printer before you print your problem job or as the first codes in the problem job. This command tells the printer to print all following commands rather than excecute them. You will get very funny looking printouts, but if you "decode" them by looking at each PCL command that the printer recieved and learning what it does (see the list below), you will begin to understand why the printer printed what it did.
If you don't see any change after sending these "debug" codes before your main job, your network connection may be resetting the printer between jobs. You may need to move the printer to a local parallel port connection to debug the problems. When you do see the print codes and you want to return the printer to normal operation, you must cycle the printer power to get the printer out of this debug mode.
| char type |
bits to store |
max range | known (commonly used) values | |
|---|---|---|---|---|
| from | to | |||
| parm | 4 | 21h | 2Fh | %,&,(,),* except for 9, E, Y, Z, and = which are considered commands (two character - no parm, group, or value) but come directly after the escape. |
| grp | 4 | 60h | 7Eh | a,b,c,d,f,l,p,r,s,t,u,v |
| value | 15-16 | -32767 | +65535 | will be either 0 to 32767, -32767 to +32767, or 0 to 65535. May have a decimal. |
| cmd | 5 | 60h | 7Eh | a,b,c,d,e,f,g,h,l,m,n,o,p,q,r,s,t,u,v,x,y,z When another value and cmd will be sent for the current parm and grp. |
| 40h | 5Eh | @, A,B,C,D,E,F,G,H,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z When this is the last value and cmd for the current parm and grp |
||
parm: <!...\>?.
group: <`...~>?.
digits: <0...9>?.
number: digits | '.' | digits ?.
| ?.
value: | sign number ?
| number ?
esc | parm | group [ value | lowercase? command ? PCLParmCmd ]
| 'W' @+value ? PCLParmCmd .
| uppercase? command ? PCLParmCmd .
| '=' ? PCLSingleCmd .
| '9' ?
| 'E' ?
| 'Y' ?
| 'Z' ?
| error .
See:
See also:
C program to convert a pcl image file to text for editing and to convert the edited text file to a pcl image file again.
Questions:
I have been told that I can take a TIFF image file and prefix it with a PCL command to use in an IBM z/Os PCL2AFP conversion tool. What is that command and what exactly do I do with it? We are hoping to be able to use this in batch processing.James Newton replies: I do not believe that is correct. There are simularities between the encoding of certain types of TIFF images and the PCL image encoding, but the headers are different so they would have to be stripped from the TIFF before the PCL header is added. Instead, I would look for existing programs that convert images to PCL. ImageMagick is one possibility.+
I am using an old dbase5 for dos program and would like to get compressed print from an HP 1320 laserjet.James Newton replies: See The PCL Typeface List and the entries for Universe Condensed.+
What PCL sequence should I use for compressed print and then to go back to normal print ?
How do I type the same character (or pattern) twice without moving the cursor on or stepping the paper on? We are trying to use PCL in a final year project at university to print a mask for an integrated circuit application where exact registration between the printed layers will be critical... We are not very familar with PCL and HP don't seem to want to help. Many thanks
James Newton replies: I'm not sure I understand what you mean by "moving the cursor on" but I assume you want the cursor to stay in or return to the place it was before you typed the character. I also don't understand how that applies to registration between layers. However...
Hi,
I am wondering whether PCL5 or PCL6 supports CMYK? I understand that PCL supports CMY color space, which means each pixel could have three components, i.e. C, M and Y. Printer might generate a K component by itself. However, if I want to generate the K component and pass to the printer, how to do it? In the other words, how to make the printer take all 4 components (CMYK) for every single pixel of the image?
I am trying to print barcode (interleaved 2 of 5) along with data. I am formatting the data in PCL and submitting it to CUPS, which ultimately routes it to Lexmark T632 printer. I am able to print the text data, but cannot create barcode with interleaved 2 of 5.
I am not sure I am asking the right question?
Any input or guidance will help.
Thanks,
James Newton replies: PCL doesn't have any inherent ability to print barcodes. If the printer has a font, you need to find the PCL code to select it (print a typeface list from the printer front panel) and then send that before the data. 2 of 5 also has an encoding that you must deal with. It should be documented with the font or with the font documentation for the printer. There are also some printers (I seem to remember Brother printers) or additions for printers (Barcode JetCaps DIMMs for HP, IIRC) that do all the work for you: Just send the selection code and the data and the encoding is managed automagically. Another way to do it is to write application code that translates the data into PCL area fill commands to draw the barcode directly.+
Dear Sirs
I always have used PCL5 but now I need PCL6 for an older DOS program (foxbase). The printer is an HP LaserJet 2840 AIO and does not support PCL5. Just a few commands wil do: changing to ARIAL and back to COURIER and changing the pitch or height of the letter.
Many thanks
James Newton replies: Unlike PCL5 which is basically ASCII printable text with commands added via the escape, PCL6 is ALL commands. E.g. There is a command to print text. I am not aware of any method of supporting PCL6 from a DOS app, but I would love to be proven wrong.+
I am trying to get a Brother Laser to print from DOS type commands and it seems to accept the PCL5 commands but never prints the data. What does it take to get the data to actually print. All of the examples show ...data here... and I assume its just normal ascii data. Can someone please tell me if this is true.
James Newton replies: It isn't clear from your question if a page actually comes out of the printer. If not, you need to send a page eject command. If so, then the only things I can suggest are that the text has been positioned off the printable area, an opaque white area fill has covered over the text, that the size has been set very small (e.g. 1 point) or that the pattern transparency or color have been set such that the text is not visable. Also, make sure you are using a printer that actually supports PCL directly. Many low end units are "WinPrinters" which depend on the host to render the PCL into a bitmap which is all the printer understands how to print.+
What does the flag '9' mean in PE command? The 'Introduction to HP-GL/2 Vector Graphics' says that the flag in PE command can be '>' '<' ':' '=' '7'. So I've found a prn file which contains 'PE9=' command. How could it be explained?
Hello, i have a problem with PCL. I try to set the cursor to a horizontal position to align amounts along the decimal comma (invoices). But i dont find any about this problem in the HP-Documentations or Internet. Ist there a way to align amounts correctly? Is it possible to set the horizontal position not only left?
James Newton replies: See Right justification of text+
http://www.hitachi-printingsolutions.us/techsup/manuals/DDP92/PCL.pdf UPDATE FOR YOUR SITE:
FOUND AT:
http://www.hitachi-printingsolutions.us/techsup/manuals/DDP92/PCL.pdf
UPDATE:
Pixel Placement
ESC l [#] R This command determines how pixels are rendered in images.
Two models are used for rendering pixels when an image is placed on paper:
0 Grid Intersection Model
1 Grid Centered Model
This command can be invoked multiple times during a page. It has no effect except to switch the model being used for imaging.
James Newton replies: Thank you for noting that. I believe that is actually a typographical error in the hitachi documentation. The HP docs list that as ESC * l # R which is more believable and seem to work on my printers. In either case, this command was missing from my list, so I appreciate your adding it.+
Hi, thank you for the answer and forgive me but I'm again here with a question. I can't get a circle by the command CL in HP-GL/2 mode (nothing happens, nothing is printed). The listing INSP1PA2400,2500EW500,0,360; works but the listing INSP1PA2400,2500CL500; doesn't. I'm doing timing tests, so using one command instead of another can make a difference. Could you please help me one more time. Thank you. Dina Sukhanova
I have written my own file on PCL-language. It works: prints 800 lines and cirles in Hp-GL/2 mode, but only on one page. How can I add transferring to a new page. Actually it should be 10 pages. My task is to test different printers. Thank you in advance. Good luck in your job. Dina Sukhanova
James Newton replies: Just exit HP-GL mode, add a formfeed character (ASCII 12) or any PCL page setup command.+
I need ability to use PCL for NUMBER OF COPIES in an MS-WORD document. Any help would be appreciated. I can't find anything from MS-WORD (other than the option when printing).
James Newton replies: Any PCL command for number of copies that you place inside the document will probably be over-ridden by Word when it prints, but the command is esc&l#X.+
I am trying to ptint labels on a paper source that is 12 inches long. I can use most of the paper but at the bottem of the page it stik the last two inches. This then move that part of the page to the next page. Is thier a command that will allow me to set the page length to 12 inches or a set of command that will do this.
James Newton replies: You should be able to send the esc&l3A command to set the page size to legal (14") then avoid printing past 12".+
I have this bat file I created using the code under Drawing Rectangles (PCL),when I run it I get this message '<-' is not recognized as an internal or external command operable program or batch file. Not sure what I am doing wrong, I have tried it with and w/o the *, putting a space before the * and after *, I even placed '>prn at the end of every line. I have window 2000 as my OS can this be the problem. (I also tried it not using the dos editor and got the same results.
James Newton replies: Try this in your .BAT file:
echo hello > prn
then if that prints something to the printer, use the instructions at Using DOS EDIT on an IBM PC to set up test files to enter the PCL commands from the Drawing Rectangles page in place of the word "hello". Remember, the Ec character is not really and "E" and a "c". In DOS EDIT, it will appear as a left pointing arrow.+
Hello I have a PCL problem . I have a PCL file and I want to extract the text from it . Like : at position 10,10 I have : "This is the beginning" ..... 10,100 : "This is the end" Is this possible ? I am totally beginner in PCL , and as I saw the file doesn't contain the characters I want to print instead some graphical stuff.
James Newton replies: Based on your description (especially the part about the text not being present in the file) I would guess that the fonts are being downloaded and that different symboles (other than the original letters in the text) are being used for each letter.
This is very (VERY) difficult to extract text from. You might try http://www.pcltools.com +
I am trying to create invoices for 4si and 8000n printers. I am getting the invoice form/macro loaded and called correctly with data, but would like more. It seems I cannot select to load the form first and then the data, it always does it data then form. Can this be corrected? I would also like a watermark to print on top/below the form and data. Is the a way to get this done?
James Newton replies: Answer: See the macro commands listed above: +
Comments:
I working on printer driver. I am trying to print bitmap on HP 930c PRINTER. I would like to get esc sequence to print the same.James Newton of James Newton's Massmind replies: Try sending the following: esc*t300R followed by esc*b8WU3//@~@~ about 30 times. You should see a nice black and white pattern that looks something like:
[ I tried Esc * b # V sequence, but not working] .Please help
W W W W WW WW W WWW W WWW W WWWWWWW W WWWWWWWBasically this is a pattern of fine vertical lines that get thicker to the right. For more see the page on printing pictures in PCL.+
Please note on HP-GL/2:+
%0A - enter PCL mode (from HP-GL/2)...
0 = Use "RTL" CAP and RTL palette
1 = Use HP-GL/2 pen position & RTL palette
2 = User "RTL" CAP and RTL palette
3 = Use HP-GL/2 pen position & HP-GL/2 palette
What is RTL? Is this PCL?
Blake Turner, infotech@precisioncompanies.com
RTL is the Raster Transfer
Language, a subset of PCL. Used to print bitmaps on printers that don't naturally
use them (namely plotters which use pens and draw lines).
+
Code:
| file: /techref/language/pcl/index.htm, 41KB, , updated: 2008/8/22 12:37, local time: 2008/12/2 13:36,
38.103.63.57:LOG IN
|
| ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://techref.massmind.org/techref/language/pcl/index.htm"> PCL5 Printer Language Reference, PCL printer, printer</A> |
| Did you find what you needed? |
Welcome to massmind.org! |
|
.