Solved

PCL language

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
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 …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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