Solved

PJL and PCL

Posted on 2004-04-12
2
1,965 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
2 Comments
 
LVL 38

Accepted Solution

by:
Herman D'Hondt earned 300 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 200 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Causes of paper jams:The following are the main causes of paper jams. Guides:If the guides for the paper are not set correctly they may cause the paper to enter at an angle. You should ensure that the guides are set correctly for the paper type a…
When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now