Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PJL and PCL

Posted on 2004-04-12
2
Medium Priority
?
1,989 Views
Last Modified: 2006-11-17
Hi,

          We have LaserJet 4 Plus and need to:

           1) Read current printer's configuration
           2) Change configuration (font in particular) to print some documents
           3) Reset configuration back.

 How can I tell if our Unix system supports PJL or PCL, also which language could be more helpful in our case ?
 Some code samples would be greatly appreciated.

 Thank You,
 -Alex
0
Comment
Question by:AlexF777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
hdhondt earned 1200 total points
ID: 10809199
We've got a number of issues here.

First of all unix does not "support" PCL, PJL or any other printer language. With unix this is all done by the application. The exception is an application called GhostScript. With GS you first create a PostScript file from your app (most unix apps support PostScript). Then GS post-processes that and converts it into commands for any of a large number of printers. Note that this still depends on a) your app supporting PostScript, and b) GS having drivers for your printer. Unix does not come into the equation.

PJL is not a really printer language. It is a set of commands to set a printer up before the printjob is sent (as either PCL or PostScript). Fonts are normally specified as part of the print job. However, PJL can be used to specify a default font, using:

Ec%-12345X@PJL DEFAULT LPARM : PCL FONTNUMBER=2
Ec%-12345X

This selects font #2, until the application selects a different one. (Ec stands for the escape character - decimal 27, hex 1B).

If all you want to do is changing default fonts, there is no need to read the printer's configuration. Simply send a PJL command to select the required font before the print job, and another one to select the original font back again after the print job. If there is anything else that needs doing, please be more specific.
0
 
LVL 21

Assisted Solution

by:wyliecoyoteuk
wyliecoyoteuk earned 800 total points
ID: 10851098
Depends on your implementation of unix.

I use Linux to print to pcl printers, you can use LPRng or CUPS to do this.

If you want to change fonts, a print filter is simple to implement, if you know the commands.

For example, I use  cat <printercommandfile> - | sed -f <formattingscript>| lp -d <printername>
to insert PCL commands into the standard IO data stream.
This inserts the PCL commands in <PCLcommand file> into the IO, at the front, then edits the file using sed, then pipes it to the printer.

Without knowing more about your UNix implementation, It is difficult to be specific.
Also, if you want to use different fonts, be aware that most printer internal fonts other than courier, are Proportionally spaced, and this will mess up the spacing on an ASCII stream which is designed for fixed spacing.
Be aware that changing fonts requires specifying proportional or fixed, and if you specify fixed, you will usually only have courier as a font.

I would suggest searching for documentation on   cat, sed, awk, and grep.
Or if you are more ambitious, Tex.

The HP PCL technical reference is quite good, and you can download it as a PDF.
Some printers use their own subset of PCL for model-specific codes, plus their Font info may differ.
Most Printers will print out a list of fonts and their command codes from the user menus on the printer keyboard.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to solve seemingly unsolvable printer issues. Users sometimes run into printing issues where all the normal steps do not seem to work. Well the steps below can show users how to take one extra step beyond the normal steps needed to remove old…
Printers have changed substantially in the last 30 or so years, not just in technical capabilities but in cost and usage as well.  Printers were originally used for interfacing with the operator, not necessarily for printing copy or pictures. In …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question