How to send control sequence to HP Laserjet
Started by Eric Tai, Feb 01 2002 05:48 PM
15 replies to this topic
#4
Posted 01 February 2002 - 08:34 PM
If you have an HP4SI Manual, hard to find, it has all of the sentax for PCL5. Do not use PCL6. We have been using PCL from within ProIV for some time. To Set Esc(Escape), that is the ASCI value 27.
#B = 27
$ESC = CHAR(#
You now have ESC in character format.
For landscape compressed printing try this.
$PCL = $ESC + '&l1O' + $ESC + '&k2S' + $ESC + '&5.467Cl12A' + $ESC + '&aoL' + $ESC + '&(8U'
This is lengthy to code so here is what we have done.
We created a file PCL_CODE
PCL_NO AK 4
PCL_DESC A 25
PCL_CODE A 100
Yous assign each type of PCL Code you would use, increment the PCL_NO by one, Describe It, and put your pcl string in PCL_CODE.
When you define your Page heading, Define the first line as $PCL_CODE Length 100, Retrieve the desired PCL_NO and set $PCL_CODE = PCL_CODE.
I normally do this with Global lscalls.
Have Fun.
#B = 27
$ESC = CHAR(#
You now have ESC in character format.
For landscape compressed printing try this.
$PCL = $ESC + '&l1O' + $ESC + '&k2S' + $ESC + '&5.467Cl12A' + $ESC + '&aoL' + $ESC + '&(8U'
This is lengthy to code so here is what we have done.
We created a file PCL_CODE
PCL_NO AK 4
PCL_DESC A 25
PCL_CODE A 100
Yous assign each type of PCL Code you would use, increment the PCL_NO by one, Describe It, and put your pcl string in PCL_CODE.
When you define your Page heading, Define the first line as $PCL_CODE Length 100, Retrieve the desired PCL_NO and set $PCL_CODE = PCL_CODE.
I normally do this with Global lscalls.
Have Fun.
#5 Guest_Anon_*
Posted 01 February 2002 - 09:26 PM
What Bill is saying (simply) is :
to get 'EcE' to reset the printer, setup a scratch variable e.g
$RESET = CHAR(27) + 'E'
Then insert $RESET within your report with length of 2 (i.e. the + E).
Obviously using this within a print will lose the print buffer, and so I wouldn't recommend it's use unless it's as a final footing!!
to get 'EcE' to reset the printer, setup a scratch variable e.g
$RESET = CHAR(27) + 'E'
Then insert $RESET within your report with length of 2 (i.e. the
Obviously using this within a print will lose the print buffer, and so I wouldn't recommend it's use unless it's as a final footing!!
#8
Posted 12 February 2002 - 12:58 AM
Hi Anon and Bill,
May I bother you guys again about how to code PCL in PROIV/Superlayer? I coded a simple report to send output to laserjet III, but the printer just printed out the PCL command along with the data.
I tried to send a simple 2 copies PCL:
the syntax is Ec&l#X, I used $DATA1 = CHAR(27) + '&l2X'
$DATA2 = $DATA1 + 'How will I make it work?'
The report prints only DATA2 and supresses the heading, no title for $DATA2.
Thank you!!!
Eric
May I bother you guys again about how to code PCL in PROIV/Superlayer? I coded a simple report to send output to laserjet III, but the printer just printed out the PCL command along with the data.
I tried to send a simple 2 copies PCL:
the syntax is Ec&l#X, I used $DATA1 = CHAR(27) + '&l2X'
$DATA2 = $DATA1 + 'How will I make it work?'
The report prints only DATA2 and supresses the heading, no title for $DATA2.
Thank you!!!
Eric
#9
Posted 13 February 2002 - 06:04 PM
Hi Anon and Bill,
I'm still having problem of sending escape sequence to the laserjet, the printer just ignore it by just printing the command with the real data: I tried to send 2 copies of the report using command Ec&i#X
$COMMAND = CHAR(27) + '&L2X'
$PRINT = $COMMAND + 'How will I make it work???'
The report prints only 1 field ($PRINT).
I need to first to make sure the simple thing works, then I will try to embed the PCL commands use barcode font and then change back to the default font, whick I need help too.
Thanks a lot!!!
I'm still having problem of sending escape sequence to the laserjet, the printer just ignore it by just printing the command with the real data: I tried to send 2 copies of the report using command Ec&i#X
$COMMAND = CHAR(27) + '&L2X'
$PRINT = $COMMAND + 'How will I make it work???'
The report prints only 1 field ($PRINT).
I need to first to make sure the simple thing works, then I will try to embed the PCL commands use barcode font and then change back to the default font, whick I need help too.
Thanks a lot!!!
#10 Guest_Anon_*
Posted 14 February 2002 - 11:44 AM
Hi Eric
I have never used the multiple copies PCL command before. I believe they are used in the UNIX scripts - you can probably see this used if you hack about in /etc/lp/interface/model.orig/printqueue if your UNIX admin will allow you ;-)
If it is just a case of testing the code, try switching to bold face.
The only other thing I can think that will allow you to print multiple copies is to try putting $COMMAND as the first thing in the page heading in the report (and suppress first page, and first line for the report). Have $PRINT to just contain the text (no PCL commands). If this works, you will get 2 pages with your one line of data. Is this what you want to achieve??
I have never used the multiple copies PCL command before. I believe they are used in the UNIX scripts - you can probably see this used if you hack about in /etc/lp/interface/model.orig/printqueue if your UNIX admin will allow you ;-)
If it is just a case of testing the code, try switching to bold face.
The only other thing I can think that will allow you to print multiple copies is to try putting $COMMAND as the first thing in the page heading in the report (and suppress first page, and first line for the report). Have $PRINT to just contain the text (no PCL commands). If this works, you will get 2 pages with your one line of data. Is this what you want to achieve??
#11
Posted 14 February 2002 - 04:20 PM
Eric:
If you are doing all this on a Windows platform you need to map your printer directly to the port (LPT1: for example) as the Windows print drivers throw out all your escape characters. That is why your commands print and the printer does not respond to the commands. I'm able to print barcode, turning the barcode on and off within the reports, on a Windows NT system using an Intel print server to connect the printer to the system. The Intel print drivers do allow the escape sequences to get through. Mapping your printer directly to your port will also work. You will have to allow for the escape sequences when calculating your horizontal print positions. Another aspect that makes it a 'not a fun thing'. Takes lots of testing.
John H.
If you are doing all this on a Windows platform you need to map your printer directly to the port (LPT1: for example) as the Windows print drivers throw out all your escape characters. That is why your commands print and the printer does not respond to the commands. I'm able to print barcode, turning the barcode on and off within the reports, on a Windows NT system using an Intel print server to connect the printer to the system. The Intel print drivers do allow the escape sequences to get through. Mapping your printer directly to your port will also work. You will have to allow for the escape sequences when calculating your horizontal print positions. Another aspect that makes it a 'not a fun thing'. Takes lots of testing.
John H.
#12
Posted 14 February 2002 - 04:59 PM
Thank you John and Anon.
We are UNIX shop, we currently send barcode to SOBAR printer without any problem. This project requires sending barcodes using HP soft fonts and regular font report output, ANON suggested to have the PCL in the heading, to send a 2 copy report to the printer is just a simple test to see the laserject accepts the PCL, but if PCL has to be in the heading, then how do I tell laserjet time to switch font in the middle of the report?
We are UNIX shop, we currently send barcode to SOBAR printer without any problem. This project requires sending barcodes using HP soft fonts and regular font report output, ANON suggested to have the PCL in the heading, to send a 2 copy report to the printer is just a simple test to see the laserject accepts the PCL, but if PCL has to be in the heading, then how do I tell laserjet time to switch font in the middle of the report?
#13
Posted 14 February 2002 - 06:09 PM
Eric:
You should be able to go back and forth with different fonts using escape sequences within your report. Somewhere you are losing the (027) character. Be sure you are allowing enough length to the strings you are printing. It can be done. I've done it on Unix and NT.
You should be able to go back and forth with different fonts using escape sequences within your report. Somewhere you are losing the (027) character. Be sure you are allowing enough length to the strings you are printing. It can be done. I've done it on Unix and NT.
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users