APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > FAQ > What are the escape sequences to select the trays on my HP Laser printer?
Printer Friendly Version




SCO Unix ® FAQ section

This article is from a FAQ concerning SCO operating


systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Printing FAQ

What are the escape sequences to select the trays on my HP Laser printer?



Back before the dinosaurs died, printers came with manuals that had all this stuff in them. Nowadays, you are lucky if it's on the CD, and if it is, good luck finding it. Here's a few that may help for HPLaserjets:


Hexadecimal Code Decimal Code Octal Code Action
1B 11 27 17 033 021 Standard Tray
1B 15 27 21 033 025 (4050) Standard Tray
1B 14 27 20 033 024 MP Paper Tray
1B 15 27 21 033 025 500 Sheet Tray
1B 18 27 24 033 030 (4050) 500 Sheet Tray
1B 16 27 22 033 026 Optional Envelope Feeder


The octal codes are what you'd probably use in an interface script:



echo "\033\030\c"


Thanks to Jean-Pierre Radley and Richard Seeder












For a complete list of Laserjet codes see http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl02705 is another.

The ones to use for printing text:

echo "\033E\c" # Reset Printer
echo "\033&k2G\c" # Set line termination mode (LF=LF/CR).

See PCL6 also.

If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

2 comments



Click here to add your comments





Wed Jun 25 13:10:25 2008:   borek


current version of link
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl02705



Wed Jun 25 14:45:53 2008:   BigDumbDInosaur
http://bcstechnology.net

Also, see http://www.sxlist.com/techref/language/pcls.htm for an extensive discussion of PCL5.

You may be interested to know that you can order a CD from H-P with a complete set of articles on PCL, encompassing both the theory and the escape codes.

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide


 I sell and support
 Kerio Mail server
g_face.jpg

This post tagged:

       - FAQ
       - Printing




Unix/Linux Consultants

Skills Tests

Guest Post Here