Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PCL language

Posted on 2003-11-19
4
Medium Priority
?
12,060 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
[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
  • 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 860 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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

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 …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…

715 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