View Full Version : PCL coding for printer
Curlyben
Apr 2, 2008, 03:33 AM
Yes, I am asking a seriously techie question as I'm stuck.
Right then.
This is for printers from our ERP system, QAD's MFG Pro EB2.1 on Progress 10.
I'm trying to recode or printers to scale print jobs on to A4 paper.
Now I have found the coding for the paper, but cannot work out how to get it to scale.
At present it prints as 6 columns, this is fine for reports that are that size, but smaller reports are badly formatted.
Here's the printer code that I'm trying to change:
HP Laser
80 column start:
/027E/027&l0O/027(0U/027(s0p18h8.5v0s0b0T/027&l66P
/027&l2E/027&l7.8689C/027&l66F/027&k2G
132 column start:
/027E/027&l0O/027(0U/027(s0p16.66h8.5v0s0b0T/027&l
66P/027&l2E/027&l7.8689C/027&l66F/027&k2G
Basically I want the print jobs to fit the page (scale) to A4.
Any help would be great as I'm seriously stuck.
donf
Apr 2, 2008, 11:43 AM
Ben
The first problem is that you are using ASCII instead of HEX is that a limitation of your software?
Next, you start each control string with the printer reset command (/027E or H 1BE). That all by it's self should cause the printer to finish the print the contents on the current job then execute the remainder to the escape sequences.
I don't have my PCL book with me because I'm tyke sitting and the two of them are taking naps, one in the crib and the other in his carrier right in front of me. I'll toddle off to office a grab the book and translate the code strings.
BTW, why don't you just use PJL to set the page size to A4? I'd place the page size in the PJL Header that you send down in front of the job.
Can you send the failing print jobs to "file" and then e-mail them to me at
[email protected]? This way I can see exactly what the printer is looking at.
Curlyben
Apr 2, 2008, 12:55 PM
Thanks for looking in Donf, I knew you'd be The Man for the job.
The coding comes from the ERP systems interface screen hence the ASCII coding.
I'm not sure if PJL coding would be acceptable at all.
Now the print jobs don't fail as such, but print allowing 6 columns, rather than scaling to the page.
I'll try and output to a file, but I'm not sure I can force the ERP system to do that. Normally file output produces a text file rather than a printer file.
donf
Apr 2, 2008, 04:20 PM
While I was waiting for my son to get out of work I took another look at the command sequences.
One major problem is that you are trying to use a command to move vertically by an invalid interger.
The command: ESC &l7.8689C is incorrect. This command will only work if you use an interger. Also, the command move vertically by7/48. Each inch is divided into increments of 48. It should be ESC&l7C not 7.8689
donf
Apr 4, 2008, 12:27 PM
Ben,
I've pretty much debugged your test file. The main problem seems to be that you are using "/027" to try to get the escape code to work. The printer needs you to do an :<alt>027 so that it can place the 0x1b escape character You should be seeing parts or all of your escape sequences printing on the page. When escape codes are working, you will see the effect of the code, not the code itself.
I created a test file for you named C_Ben.asc. I had to email it to myself because my wireless network has been crashing from time to time today.
When I get the file, I will append it here. When you get the file, copy it to a printer, just as it is. You should get two pages out. Page one will be a test of your codes, after I fixed them and page two will be a page showing you the various effects of changing the Vertical Motion index and the Horizontal motion index.
donf
Apr 4, 2008, 02:46 PM
Ben here's the test file.
djames8y
Dec 2, 2008, 07:17 PM
Some of these answers are wrong
/027 is correct escape sequence for this code
You most likely have a conflict with the code page size versus margin versus length
donf
Dec 4, 2008, 06:49 AM
None of the answers were wrong.
The problem was the insertion strings were required to use the "/027" string to flag the escape character.
That particular format has not been used since it was a Lotus Notes requirement.