Solved

PJL and PCL

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing causes application to got into "not responding" 6 67
help with a printer in windows 10 6 70
IR 1023 Scanning 4 59
SharpDesk V3.3 Scanning Issue 7 52
This seems to be a very common error related to the Samsung printer driver. First, this is the error we're talking about: Log: System Type: Error Event: 7000 Agent Time: 3:37:24 am 22-Apr-09 Event Time: 6:07:24 pm 21-Apr-09 UTC Source: Se…
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 …
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…
Suggested Courses

732 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