Solved

PCL language

Posted on 2003-11-19
4
12,054 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HP Office Jet pro 8600 printer 4 103
Printer ink cartridge issue? 22 59
Printing A1 on A4 Printer 8 107
Best way to share an MFP laser printer? 5 60
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…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

15 Experts available now in Live!

Get 1:1 Help Now