1823470 Members
2324 Online
109660 Solutions
New Discussion юеВ

Using PCL codes...

 
Kevin_282
Occasional Contributor

Using PCL codes...

Where can I find examples of using PCL codes through various programming languages i.e VB, FoxPro etc.?
8 REPLIES 8
Rebecca Putman
Frequent Advisor

Re: Using PCL codes...

IIRC, all you really need to do is set up a print queue with the appropriate symbiont for the HP printer; from there, you set up your programs to use that kind of printer and point it to that queue; the software should do the rest without needing you to code in specific PCL codes.
Kevin_282
Occasional Contributor

Re: Using PCL codes...

Thank you for your reply. At the moment we have some software applications written in FoxPro for Dos that uses PCL codes to print statements etc. What I would like to find is examples of code written in other languages to see how they compare with the code we use.
Antoniov.
Honored Contributor

Re: Using PCL codes...

Hi Kevin,
PCL standard is evolved since dos application; most common code are still valid but on new printer there are some difference.
Mainly PCL5 and PCL need code sequence introducer before starting print as E (escape followed by uppercase E).
If you need PCL standard you can read follow pdf document http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13210/bpl13210.pdf

I use PCL code for my application: if you meet some trouble post again I'll answer you.

Antonio Vigliotti
Antonio Maria Vigliotti
Kevin_282
Occasional Contributor

Re: Using PCL codes...

Thanks for that Antoniov,

My problem is as follows. I have a printing application written in FoxPro for Dos which we use for printing Statements. These Statements work fine when printed to a LexMark printer. We have now purchased a Canon printer and some of the codes do not now work. Everytime we send a print job to the printer a bank page is output with an 'E' printed on the top left hand corner. Also we need to print signatures on some of our Statements but when I copy the Signature macro to the Lpt1 port another blank page is output with '&alG' printed on the top left hand corner. The Statements then print offline after this. I have attached the PCL code currently been used if that will help. Idealy we should probably use Visual Basic or another programming language to print the Statements but at the moment our code is written in FoxPro so I am under a bit of pressure to get this working. What programming language do you use? The Statements we print are quite complicated i.e. we have to underline headings, draw boxes, output data using different fonts etc.

Thanks,

Kevin.
Antoniov.
Honored Contributor

Re: Using PCL codes...

Kevin,
first I think you wrong forum ... however ...

You have some dos application sending PCL code to printer; your application start with esc E and this is right; I don't known other codes but I suppose they are right.
I guess your trouble is not in dos application but in windows/driver/printer chain; most printer can't yet work in dos emulation but only using windows driver; when your application send introducer code (esc + E) the control code esc is discarded by windows driver and printer recevice only uppercase E and eject page because has not recognize the PCL reset code.

Question are:
1) Can you send simple text (without control code) to printer?
2) Do you find a dos driver in CD of your printer (some printer have 2 drivers, one for windows and 1 for dos)?
3) Your printer in sold only for windows or for unix too (if is not unix compatible, means doesn't accept escape code directly to device)?

H.T.H.
Antonio Vigliotti
Antonio Maria Vigliotti
Kevin_282
Occasional Contributor

Re: Using PCL codes...

Hi Antoniov,

The problem is most of the PCL codes work apart from the two mentioned i.e. a blank page been ejected with 'E' been printed and the signature macro command. Will look into the dos driver situation.

Thanks,

Kevin.
Antoniov.
Honored Contributor

Re: Using PCL codes...

Kevin,
if most code works, driver might work fine.
I'm amazed esc E doesn't work.
About macro, I never used them so I'm not sure you code is right for new printer; reading HP documentation seems macro code is supported as you wrote in your foxpro example.
May be a wrong page definition: I guess you are using A4 paper (or legal paper) but you have not defined this page format.
After PclSetup procedure, can you print a simple text?

Antonio Vigliotti
Antonio Maria Vigliotti
Kevin_282
Occasional Contributor

Re: Using PCL codes...

Antonio,

Will try this and see how I get on.

Kevin.