Link to home
Start Free TrialLog in
Avatar of louwin
louwin

asked on

PCL Programming

I am having trouble with PCL printer programming and hope this isn't too specialized a topic.  We have - invoices, statements, purchase orders etc etc all continuous stationery for a multi company business and it is all getting out of control so -

I have been trying to get our lasetjet 2100 printers (we have about 10) to print "pre-printed" stationery with an "overlay macro" in PCL5 but cannot get the following data to print less the one and a half inches down the landscape form.  I can print the invoice on the laser perfectly and it starts printing right up the top of the A4 sheet as expected - beautifull!  I send an "overlay macro" and the invoices data prints about an inch and a half down the form.  I have tried to position the cursor in PCL before the macro, after the macro and both before AND after the macro without success.  I have tried the positioning in the HP/GL2 segment and using the exit Ec%1A and all sorts of combinations but cannot cause the invoice data to print any higher than 1.6 inches down the page.  I have included the "macro" below.  That little boxes are "escape's".

E            reset
&l1O         landscape
9            reset margins
&l2E         ditto
&f1Y         define macro 1
&f0X         start macro definition
%0B          enter HP/GL2
IN;           inialize
SP1;          select pen

the following coding draws boxes and lines

PA0,2100PD8400,2100,8400,4500,0,4500,0,2100PU;
PA3000,2100PD3000,4500PU;
PA3900,2100PD3900,4500PU;
PA4300,2100PD4300,4500PU;
PA5100,2100PD5100,4500PU;
PA6000,2100PD6000,4500PU;
PA6000,2100PD6000,1600,7000,1600,7000,2100PU;
PA7000,2100PD7000,4500PU;
PA7500,2100PD7500,4500PU;

PA0,7300;      position cursor
%1A           exit HP/GL2 with cursor  positioning
&f1X          stop macro definition
&f4X          enable overlay
&f10X         make macro permanent

If I send the invoice without the overlay it prints as expected.  If I send the above overlay first it prints too low.

I tried just print the word "INSERT".  Without the overlay it prints right on top.  With the overlay it prints 1.6 inches down the page.

I've tried ALL sorts of combinations, this is the last I tried.

Help!

louwin
ASKER CERTIFIED SOLUTION
Avatar of spangler011300
spangler011300

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of louwin
louwin

ASKER

Hello Spangler,

As you can imagine I continued to experiment and eventually got things to work.  As with the rest of the macro, pixel rather than column positioning, I used <esc>&a0h0V to position the cursor.

The real problem was the fact that each line in the original programming sequence ended with a line feed.  The printer was interpreting all the commands and after each was linefeeding.  I concatenated all the commands and Viola! everything started to work.

My printer (Laserjet 2100) does support HP/GL2 in macros but very unreliably.  Sometimes it would print the lines, sometimes (more often) not, so I had replaced the HP/GL2 with PCL alternatives.  I proved this by issueing the original commands as a normal print file and the lines ALWAYS printed correctly.  I then made it a macro only to have the lines NOT print.  I spent hours trying to get the HP/GL2 working before changing to PCL as a last measure.  I don't know why the HP/GL2 didn't work but that is now moot as PCL works fine.

I was having a lot of trouble getting a logo on the top left hand side of the page but am now following advice from my brother and doing ALL the overlaying etc on MS Word.  The problem with this method is that, in my previous experiments, the printer driver outputs PJL and I don't know how this will interface with the following data.

I have added this LONG comment to the solution to help any other poor @#$%^& who tries to do soemprinter overlay programming.

Thanks,

Louis