PCL 6 commands are typically binary and therefore more compact. However, PCL 6 lacks some features of PCL 5 and is closer to Windows GDI than a PDL. All PCL 6 printers also support PCL 5.
Quoting from the "PCL 5 Printer Language Technical Reference Manual"
Hewlett-Packard created the PCL printer language (simply referred to as "PCL" elsewhere in this manual) to provide an economical and efficient way for application programs to control a range of printer features across a number of printing devices
PCL commands follow a consistant specification with industry wide acceptance to control common printer features ranging from source paper tray selection, font and graphics layout, through macro recording and play back of common form elements
PCL 5 commands begin with the ASCII Escape character (decimal value 27, hex 1B, abbreviated as Esc) and end with the first uppercase letter. Some commands may be followed by binary data or data in another language. Esc ? ? # W were ? is any lowercase letter or symbol other than a numerical digit and # is zero or more numerical digits, typically indicates that the number of bytes indicated by # of binary data such as for an image, character or other bitmap will follow the W. Esc %0B is followed by a number of HP/GL commands which follow a different format.
Any text that is not preceeded by the Esc is printable text.
Esc *p100x200Y is an example of a common PCL5 command that positions the cursor at 100 units left of the upper left corner of the printable area of the page and 200 units down from the type. Coordinates are in the 4th quaderant. Notice that the value preceeds the parameter identification character. e.g. 100x is 100 units in the "x" or left direction. Esc *p100x200YHello will print Hello at (100,200).
Esc E is another example of a common PCL5 command. This command resets the printers internal state machine to known values and is commonly found at the start of a print job.
PCL5 print jobs often include other languages including PJL and HPGL
Other page description languages include PostScript, and ESC (injet printers).
With MS Windows, PCL fonts are "introduced" to the operating system and HP written printer driver (not printer drivers for HP printers... drivers actually written by HP) using:
Little known facts
HP documentation is available from HP,
NOT from us!
See: http://www.hp.com/cposupport/printers/support_doc/bpl01354.html $150 (CD or hardcopy?)
or http://www.hp.com/pond/cdrom/prodselect/pclpjl.html $0 + shipping on CD
Please note: These questions have been answered because they are of general interest and do not cover topics that are propriatary. Not all questions can be answered and payment is expected for complex or valuable answers.
I need to print some reports from a character base system. The client has asked for some minor font changes. so I am trying to use some PCL5 commands to do this. However I cannot get the printer to recognize the escape char. (at least I think that's the problem). Is there something in the printer setup that would ignore the PCL code or do I have to turn PCL mode on?
My first simple test was to create a text file with some data and then place a bold set of dashes in it. This is what I have and it prints out the same way: (s#B3 ____ (s#B0
Thanks for your assistance.
I have a C# application that needs to extract a few text fields out of a PCL file. Is there an easy way to convert the PCL to text so that it can be searched? Thanks.
Hi, I have developed a program that parses a prn file created with HP Laserjet 4 or 4+. It then manipulates the pcl allowing me to generate dynamic forms. I wish I could control the printer driver itself. Do you know where I can find open source driver software which produces PCL like lj4? Thank you!
I want to generate simple PCL file from text file . Reason for doing this is I want to write HP printer driver for embedded system.
For example : conversion of file which contains text like Hello to PCL.
I just wanted to write printer driver which would be capable of printing simple text files
James Newton replies: Standard text files will print on a PCL5 printer with no modification. Just copy the text out to the printer and you are done. Add an EscE to the beginning if you like, to reset the printer. You can set the font with the codes for font select.+
I have a PCL file with colored text and another PCL file with a rastered bitmap. When I send them to printer (hp deskjet 5150, with drivers hp deskjet 5100 series for Windows XP), I obtain the following:
Colored text: text is printed in black.
Colored image: black line.
To send them to printer, I have done a program to send raw text to printer (win api) and I have also try "copy /b" command. None of them works.
I have opened these files with PCL Viewer and in both cases, I can see colored text and image correctly. I have printed them ok from this viewer.
I have also tried to print same files but in black and white and I can see everything ok.
It seems to me that color printing is nor working for this printer hp deskjet 5150. Should I need another driver?, some kind of configuration?.
Any help would be appreciated.
James Newton replies: This is a classic example of the differences between PCL versions, and between pre-rendered PCL code and the rendering from drivers.
Your PCL Viewer supports all versions of PCL, so it shows the correct image no matter what version of PCL was used to create your PCL files. The printer is PCL3, so it can't understand the commands used to present the elements of the print job that are different between PCL3 and PCL5. I'm assuming your PCL file is a PCL5 print job.
The PCL file is already rendered to PCL by a printer driver or some other means of producing finished PCL. The windows printer drivers on your computer do not accept PCL, they produce PCL and accept GDI commands from a windows application. They can not take PCL5 commands and translate them into PCL3 commands for the printer. If your PCL Viewer can produces GDI print commands, the windows driver will translate those into PCL3 and the job will print correctly.
Summary: You can't expect a PCL3 printer to understand a PCL5 print job and a PCL Viewer will translate PCL? into GDI, which an appropriate windows printer driver can translate into PCL3.+
Hi all. I really need a PCL Library that I can access from VB6.... Something that allows me to position a box, and center text using Built in NP Fonts... something that allows me to specify a JPEG and output it... I have something like this fro Clipper, and love it. I want to be able to build and design my Pages in Pure PCL (Since I use Tons of Macros), and call it from VB... Most font calls, etc. are easy and I've written my own code, but Image conversion to PCL image layout, and Centering calcs for NP Fonts, I can't get a grip on. Suggestions anyone? Thanks! Bill
James Newton replies: You probably will not find any support for direct PCL generation in the more modern languages. That is the point of having printer drivers for everything in windows, we don't need to mess with the details of the printer languages anymore. Your best path is probably to abandon your current method and learn how to print to the windows driver the standard way. If your macros are form images, you may be able to use a PCLViewer or converter to make them into eps or other graphics which can be used in VB6.+
Hi, I woul like to know this, I need data from my print burst so that I can compile it to be used with a control program which operates a product tracking system. The print burst contains all of the data I need, but I dont know how to view and capture the print burst. Can you help?
Dear HP printer guru,
Could you please shed light on the auto page size select that operates with some HP printers (HP1160) but not others (HP1320). Documents formatted to a particular page size ie. Envelope DL cause some HP printers to auto select the size and orientation via the manual feed bin, overriding the default (say A4) page in a bin. This is a desirable feature since it allows various envelopes and the like printed as required by manual feeding. Seems starnge that the feature is present in some modern HP models and not others.
Thanks for any advice and regards,
ImageWare Technologies Australia
James Newton replies: The only advice I have is to not depend on the printer and always specify the tray after you specify the size in the print job. Of course, that assumes you control the printer driver.+
I am able to print my document in landscape view now. However, the content still can't be fit into an A4 paper size. Is there PCL command similar to Windows "fit to page" selection in printer properties?
i want to print DOS compiled HPGL2 code via a HP4050TN in duplex mode from a VisualDbase5 software. It works well in single page mode, but I can't find a Duplex command in HPGL2. Or do I have to sent the Duplex code first under PCL5/6 to the printer? TKS in ADV
My company software specifies the escape sequence to the printer to set the print format. Now it requires to print in landscape with 10 cpi.
What i found is for for 10 cpi then sequence is :
27 40 115 48 72
and for lanscape is:
27 38 108 49 79.
Thus am i correct by just combining both of it to construct the correct escape sequence for it?
This may be basic, but can you access PCL via HTML? If so how? Looking for help to print a signature from a HP 4200 dimm via HTML or a cascading style sheet (CSS) - Thank you.
Have just purchased new laptop with win XP and only USB ports, previously used Win 98 SE with most printing from WP 5.1+ DOS. Have 2000 research code sheets, patient letters etc. Many have narrow top margins, so that after converting to Word, I am worried they will not print to newer printers: Questions: 1) what is last version of PCL which was good with DOS? 2) If I want to squeeze a newer printer or use backward compatibility, (LJ 4+ can handle narrow margins) do I lie to Windows and tell it printer is LJ II, III, 4+ or is there a better way? RI Pfeffer, Emeritus Prof.
James Newton replies: Answers: 1) PCL is independant of DOS. DOS never did produce PCL itself but many DOS applications produced PCL 4 or PCL 5 code. 2) Almost all printer drivers allow you to set the margins within the ability of the printer. E.g. the driver for a LJ 4200 will allow you to set a top margin of just about anything more than .17 inches. I always use the LJ 4+ driver since all printers made since that are backward compatible and there are very few features added since the 4+.+
I have a network addressable printer attached to the LAN with TCP/IP. The printer has an FTP server running on it, so you can FTP files to it froma anywhere on the intranet. When you do an FTP PUT fn.ext to the printer, it prints the file.
How can I issue PCL commands to this printer from any TCP client on the LAN via an FTP put?
We have a bespoke system that requires all of the PCL5 printing commands entered manually, this worked brialliant with the 2200 and the 2300 but when i set up a 2420 using the same commands it doesnt seem to print the last page of a multiple page print job - until the next print run or u press the button.
I have called HP - AND THEY DO NOT KNOW!!! Please help, as i dont even know what the problem is to search for the command to fix it!!!
I would like to print a page in landscape format.
I have tried the ESC&a270P, at several places in the code, that doesn't work.
Is there a specific place where to put the command ?
Is there another command ?
Can I control page breaks by just using the just page length size? ie will the printer automatically move to the next page when the page length is reached?
James Newton replies: Yes. Assuming no other page control commands (e.g. form feed, set page size, etc...) are recieved. You man need to enable performation skip with Esc&l1L before you start printing your text. That is the escape character, an and sign, the lower case letter L, the number 1, and the upper case letter L.+
Is there any documentation that compares PCL5 with PCL6 on a command basis? I have programs that embed PCL5 ESC sequences in the output text and I need to convert them to PCL6. Also, I printed a test file to a PCL6 .prn file and can't find the Form Feed. What does PCL6 use as a FF?
James Newton replies: There is no "one to one" comparison between PCL5 and PCL6. PCL 6 is based on the Windows GDI commands so it works in a totally different way. It is also much more complex and more difficult to generate directly. There are some notes on the PCL6 page above, but in general you will need to contact HP for PCL 6 documentation.+
Nitin Bhatnagar of ABC replies:
That's correct. Infact, PCL6 is totally different in a manner that it works on binary streams rather than esc sequences. For ex., for a form feed which you are asking, it has a "BeginPage" and similarly an "EndPage" operator. You will have to decode this in the binary stream. For more info on how to decode it, please refer HP PCL 6 documentation. I have done a similar kind of conversion in the past but for a limited functionality.+
Hello, I am new to PCL 5e on a Troy HP 2100 and am having trouble with text justification / alignment. Can you please tell me how to best attain the width of a string of proportional-width text (printer font - Arial), prior to sending it to the printer. I am programming in .NET. Thank much.
James Newton replies: The direct answer to your question lies with the Windows printer driver and GDI, not with PCL. To justify correctly in PCL without knowing the character widths in advance, see: Right and center justification in PCL.+
I am trying to create a batch file to run that will change the number of copies on a HP9000 dn printer.I have found the control commands, the batch file reads as follows
copy Ec(escape charcter ,a left arow ?)&l5X > LPT2 where LPT2 is mapped to the network printer.When I run the HPCOPY.bat file in a command prompt it says
The filename, directory name, or volume label syntax is incorrect
0 file(s) copied.
'l2X' is not recognized as an internal or external command,
I know it is a bit simple for you guys,but can you help me please?
James Newton replies: Windows NT and above command prompt (and batch files) interpret the & sign as a command seperator. i.e. it starts a new command. so your command line is seen as two seperate lines:
copy Ec &l5X > LPT2
You can correct that by placing a carat (^) in front of the &
Secondly the copy command is used to copy the contents of one file or device to another and does not copy characters in the command line itself. You want the echo command.
Try this instead:
Can anyone reply to follwoing queries?
1. Can I create a PCL using Notepad?
2. Does the "Print To File" generates PCL?
3. Is it possible to convert PCL back to ASCII?
1. No, but only because it can not generate the escape character that is required at the start of any PCL command. If you have the escape character in a file, then you can edit that file in notepad and copy the character. The exception is PCL with binary data such as font downloads and images. Notepad is not a binary editor.
2. If the printer driver installed is PCL
3. That depends on a long list of things. Among them are the font used to print the data in PCL, the font settings in the printer driver used to create the PCL, the original source of the text, etc... See pagetech.com for solutions in this area.
vincent-datascanpharmacy-M96 replies: In reference to (1), you CAN produce PCL from notepad but it requires you to know the ASCII DECIMAL code for the characters rather than the HEX code. For example, ESC is ASCII decimal 27. In notepad, hold ALT and using the NUMERIC KEYPAD (this WILL NOT WORK with the numbers keys on the top of the keyboard) press 2, then press 7, then release the ALT key. You will see the arrow pointing to the left appear at the cursor position. That is the escape character. Most PCL documentation provides the DECIMAL as well as HEX codes for the escape sequences. Make sure you use the DECIMAL code with this technique. +
Hi, I would like to download a micr font to our printers and make it permanent. But before I buy the micr fonts, I read through the pcl technical reference manuals about how to go about downloading the soft font. I still can't figure out how to do it. Can somebody help me please. By the way, I am trying to do this from the mainframe.
James Newton replies: Use HP software called Forms and Font Manager which should come with any FLASH memory or hard drive option for the printer.
If you mean "Perminent in RAM" I would not recommend this for a network connected printer. Network cards seem to clear RAM even when you tell the font to be perminant. The "Make previous font perminant" command is clearly listed in the PCL5 tech ref.
If you have an HP 2300 or 4200 or newer printer network support does work if you use the "RAM disk" but you will probably want to get Forms and Font Manager or the FSA (File System Architecture) documentation from HP.+
I was able to print micr fonts on HP laserjet 4si, and 8000 series but I can't seem to print the micr on 5si, 8150DN, 9000 and Troy 9000 series printers. I am using the PCL command <esc>0Q to access the E13B font. Does the E13B font differ between printer models?
James Newton replies: It can. You need to print the PCL font list from the front panel of the printer to find the exact selection string for the font. It may very well be that this font is not installed in all the printers you are trying to use as it is NOT a standard font.+
I need to print the current Windows Account Username in the footer of every page of every print job - no matter the application software. I looked at the separator technology, but it seems to provide the inclusion of additional pages, rather than changing the actual print job pages.
I think what I'll need to do is intercept the PCL printer output from the driver and modify its content? If so, is there a PCL command that I can include that will enter a username footer on every page.
Any assistance would be appreciated.
James Newton replies: In a word, no. You would have to first parse the PCL printer output to find each end of page, then insert at that point a font selection command, cursor positioning command and the text of the users name. This is a lot of work... You might be better off looking for a printer driver replacement that could do this for you.+
How can I know how many pages are there in any pcl binary file.
Looking for form feed does not work as I have found so many 0xC in this three page document file
James Newton replies: You are getting extra 0x0C characters from the binary graphic data in the print job. To skip these "fake" form feeds, you must parse the PCL commands, looking for any that end in a "W". The number just before the W is the number of bytes of binary data (after the "W") to skip.
Note that although most page ejects are caused by form feed characters, there are several other ways to end a page in PCL.+
James Newton replies:
First, I assume you mean PCL 5 when you say PCL 6 above. The commands you are trying are PCL 5 commands, and will not work in PCL 6 print jobs.
I think the problem is that the printer is running out of room to print line2 and starting a new page to compensate. Try starting this sequence higher and/or more to the right.
I want to print large documents in half-size booklets. For instance, groups of 12 pages can be printed on 3 sheets each. This would involve:
A) Parse file into pages (by control-L characters?).
B) Re-order the pages 8 5 10 3 12 1 6 7 4 9 2 11.
C) Shrink the pages to half size.
D) Printing them in pairs side-by-side in landscape mode.
E) Duplex the pages (2 11 on back of 1 12 etc).
The question is, how do I shrink the pages to half size?
James Newton replies:
That is really not easy in PCL. Since all sizes and positions are specified absolutly, you have to find and divide by two all:
- cursor positions
- area width and height
- font sizes
- bitmaps (oh boy! and that includes bitmap font images)
- and so on...
A better idea would be to find and double any commands that specify the resolution; a 600DPI document prints half size at 1200DPI. Since 1200 is usually the top resolution, you are sunk if the original is already at 1200, but that should be rare. Also, some printers don't support 1200 (and the really old ones only supported 300)
The only other idea would be to see if your printer supports an @PJL command to reduce output. I don't think any do actually, but that would be the logical place to put it. Please let us know what you figure out!
I need to know what progam will open my PRN. I have a print job to a file and niw I can't open it up. Would you tell me in what directory is the .exe file to open a print file saved in a folder.
I am generating some reports using Foxpro For DOS. I use PCL codes to draw boxes, lines, etc. How can I convert the reports to a faxable image(raster image)? Shuold insert PCL using hex values? Thank you in advance.
James Newton replies: There was a fax modem that came with software that would do that... It was an Intel unit... I think it was called a "Satisfaction" or something like that. Today, you can purchase a toolkit from Robert Pooley at PageTech.
Is there a way to tell the windows PCL driver to only allow letter size. I can do this for PostScript driver by editing the PPD file but what mechanism is available in PCL.
James Newton replies: Good question... I don't know. I'm assuming you want to keep users from hanging a network printer by selecting a page size that isn't loaded and then not servicing the printers request for the other paper size.
You might be able to get an answer from the HP forums http://forums.itrc.hp.com/cm/CategoryHome/1,,219,00.html (be sure to put a descriptive title on the question e.g. "need WIN PCL driver to allow only letter size", include a complete description of WHY you need this and exactly what you do in the PS driver and what you have tried in the PCL driver and be sure to follow up and assign points to the answers)
Please let me know if you find an answer.+
I am using 3 PCL commands in a Word document. One selects from the approproate drawer, one controls short or long edge duplexing and the third controls the number of copies. My problem is when I print, say 3 copies of the document, it does not collate correctly. Page 1 and 2 print duplexed 3 times followed by page 3 printing 3 times. Is there a way with PCL printer commands to control collating so I get page 1-3 together instead of page 1-2 grouped then page 3 grouped. I've included my PCL commands being used in my document.+PRINT 27"&l2S" --- Duplexing PRINT 27"&l20H" -- Paper Drawer PRINT 27"&l2X" --- Copies
James Newton replies:The problem is that MS Word is also asking the printer driver to send codes for these things and its codes are interferring with your codes. The best thing is to use the settings in MS Word for number of pages, etc...
Im trying to use PCL to change fonts and merge with overlays on a printed document using a number of different HP printers; some 5si, Laserjet 4000, IIIp, etc. It works on the 5si printer but am having problems on the others. My question is - can this be down to the version of PCL Im using? Many thanks, Julian Palmer.
Sure... All of those printers support standard PCL5 commands. If you have it working on one printer the only possible difference is the non-printable margin size between the different models.
Hi James! That's the most useful article I have found about PCL!James Newton of MassMind replies: Inkjets are PCL3, and sadly, I have no experience with them or it. Best wishes.+
I'm trying to find a way to edit PCL code of a file so that my printer uses a particular ink. It's a CMYKB inkjet printer and I need to print a pattern with particular order of inks (I will replace inks with some chemicals). I have been searching any info about ink selection in PCL/PJL, PS before hacking the electronics and controlling the printheads. I would appreciate any input on this.
|file: /Techref/language/pcls.htm, 65KB, , updated: 2022/1/26 09:08, local time: 2023/2/5 22:42,
|©2023 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?|
<A HREF="http://www.sxlist.com/Techref/language/pcls.htm"> PCL, HP Printer, PDL, Printer Control Language</A>
|Did you find what you needed?|
Welcome to sxlist.com!
& kind contributors
just like you!
Please don't rip/copy
Copies of the site on CD
are available at minimal cost.
Welcome to www.sxlist.com!