Solved

PCL language

Posted on 2003-11-19
4
12,052 Views
Last Modified: 2013-12-15
Hi,
    I am writing an application which generates the printer language for my custom apllication.
I am trying to generate the specific PCl5 language for my laser printer ( HP Color LaserJet 5M )
using java. The code I am using is shown below. It creates the PCL5 command as a string. Then it converts it to the bytes and pushes it to the printer. Since I am pushing it in the autosense mode the printer should understand it. But I am getting offending error. The printer is not recognising my PCl5 commands.Is there any problem with the PCl commands I am sending. I doubt whether the escape character is being send correctly.

char x = (char)27;      
String l_printInput= x+"E" +x+ "&l0E" +x +"&a0c0R" +x+ "*c2400a3300b0P" +x+ "*c0P" +x+ "E";
byte[] l_printByte = l_printInput.getBytes();
DocFlavor l_docFlavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
Doc l_doc = new SimpleDoc(l_printByte , l_docFlavor , null);
l_printJob.print(l_doc , null);
       
    Also is there any sites in which I have some examples for using PCl5. I have the reference manual from HP but without examples I am not able to use it fastly.

Rgds
jack
0
Comment
Question by:crackjack010
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 9787688
Why do you start i_printInput with a printer reset ESC-E and end it with an ESC-E?  I think the ending ESC-E gets rid of the features you just turned on.
0
 

Author Comment

by:crackjack010
ID: 9794246
Hi,
    Thanx a LOT. It worked.
Can you please help me with two more doubts that I have.
1. When are these  printer reset commands used. I mean should I reset the printer after I print my stuffs using PCL. Because I removed only the initial reset only and it worked.Then I removed the end one only and then it worked. And now when I didn't remove both it is working.And now when I removed both it is working. I don't know what is happening.Because the same was not working yesterday.
2. Also is it necessary that I should send the PJL commands for every print job I send.
Can you also send me a basic (IF possible) structure of the PCL5 code I should send. Say the PJL command first (Esc-12345X first etc..).then comes the PCL commands.Or an example pcl file.
Thanx any way for the help.
Rgds
jack
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 215 total points
ID: 9798368
Usually, you send a reset at the start of the first printed page and another at the end of the job to clean up.  The ESC-E reset is a PCL (not PJL) command.

You should never assume the printer is setup the way you want it.  Always sent the complete set of printer commands necessary to configure the printer the way you want it.

The PJL code should be sent first.  PJL has nothing to do with your printout, but how the printer itself is set up.  The PCL codes should be embedded into your data as necessary to format the page they way you want it to appear.  Remember that PJL stands for Print Job Language and PCL stands for Page Control Language.

A sample is going to be difficult - I don't know what you are printing or how you want it to appear.  Glad I could help clear up your question.
0
 

Author Comment

by:crackjack010
ID: 9808281
Thanx a lot.
Will Get Back to U once I have some more problems. :)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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

11 Experts available now in Live!

Get 1:1 Help Now