Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Character on Each Page

Status
Not open for further replies.

bdunca1

Technical User
May 18, 2007
3
US
Hello,

I am very new to PCL and am trying to use it to compensate for a flaw in a software application. The report prints from the application onto a preprinted form and must align correctly. I am using an HP LaserJet 8150DN Printer (Generic/Text Driver).

For the Begin Print Job printer command I am using the following codes:

<1B>E<1B>&k0S<1B>&l0E<1B>&l6D<1B>&l66F<1B>&l8C<1B>&l5H<1B>&k12.04H

These codes works to align the text from the application on a pre-printed form. What I need to do is to place the character "9" on each page that prints. It needs to be located on the 54th line and to the left of the logical page defined in the Begin Print Job commands.

I have had luck using these codes as the End Print Job print command; however, this places the character "9" only on the last page that prints.

<1B>&a0R<1B>&l-59U<1B>&a54R9

How do I get the character 9 to print on each page, on the 54th row 59 "units" to the left of everything else?

Thank you for your help!
 
The only way to do this in PCL that I know of is to embed the following code at the end of each page:

<1B>&a0R<1B>&l-59U<1B>&a54R9<1B>&a0R<1B>&lU

You also might note that <1B>&l6D and <1B>&l8C mean exactly the same thing and are there for redundant.
 
Another way would be to include <1B>&a0R<1B>&l-59U in the begin print job sequence, shift all data one column right, and print a "9" in column 1 of line 54.
 
Thank you for your help! With regard to your second post, I am limited to using PCL codes to accomplish any changes in alignment and add the character "9". Are you familiar with "overlay macros"? Would this be a solution?
 
An overlay should be perfect for what you are after.

An overlay macro lives in it own environment, so you should be able to have the left offset you need in the overlay, but not in your regular print. Lets call it macro 101.

<1b>&f101y0X<1b>&l-59U<1b>&a54R9<1b>&f1X<1b>&f101y10X

That should be all you need. Then in your regular print you need to put <1b>&f101y4X somewhere to enable the macro as an automatic overlay.

The beauty of the overlay is that you don't have to deal with the CAP after you have printed the 9. You may have to change those parameters to suit.


Jim Asman
 
Thank you so much! You are a life saver!

As I mentioned, I am very new to this. Where to I put the macro code?

<1b>&f101y0X<1b>&l-59U<1b>&a54R9<1b>&f1X<1b>&f101y10X

Does this go in a text file on the print server. The name of my print server is \\ps01. If so, how do I get it there and what do I name the file

Can I put the code to call the macro in the Begin Print Job printer command along with the other codes that set-up the logical page. For example...

<1B>E<1B>&k0S<1B>&l0E<1B>&l6D<1B>&l66F<1B>&l8C<1B>&l5H<1B>&k12.04H<1b>&f101y4X
 
The code for the macro only needs to be sent to the printer once at the beginning of the job. It can ptetty well go anywhere and typically would be sent as part of the init.

Experiment a little bit. If your format stuff is only sent once, I would put it BEFORE the <1b>E. In fact, I would add another reset...

<1b>E MACRO STUFF <1b>E YOUR EXISTING INIT ...



Jim Asman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top