Solved

PJL and PCL

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

Accepted Solution

by:
hdhondt 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you use a Brother DCP 130C or similar Brother printer, at some point you might encounter the following problem: after you change the ink cartridge, the printer displays an "ink empty" message. Sometimes you just need to follow the instructions…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

688 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