INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

PCL printer commands to a LJ4... issues!!

PCL printer commands to a LJ4... issues!!

(OP)
I'm outputting sheet labels to an LJ4 printer, using the HP PCL escape sequences to control the printer. (Has to be accurate so the labels will come out right on the sheets).

When I just used the page length and page margin commands (chr(27)+"&l60P" and chr(27)+"&l5E)", it doesn't work right... either asks for Exec paper, or just runs off the bottom of the page onto the next page. I solved that by just using the page size command (chr(27)+"&l2A"), but then I can't control the top margin... it just stays where it is, which is off by a line.

Any hints? Can I not just tell the printer how many lines long my lables are and what top margin I want? (Apparently not).

I'm an amateur who's written my own program (20 years ago) for my own business, and am maintaining it, but not writing enough code to stay very current...

Frank

RE: PCL printer commands to a LJ4... issues!!

Hi, Frank

It's been awhile so I don't remember offhand, however you will find a good PCL reference here:
http://printers.necsam.com/public/printers/pclcodes/pcl5hp.htm

Likely you will have to experiment a bit (lot?) to get it right.

Personally I usually just write a CSV file and use it as input to a MS Word mailmerge using one of their standard label templates - saves a lot of grief when using different printers.

Jock

RE: PCL printer commands to a LJ4... issues!!

Frank,

I have a program that prints billing coupons, four to a page, I had to go nuts to make it work.  Strip off the top & bottom margins, half line feeds, change the pitch, print to a OCR font.  Start at the top and work down, get the first row of labels set then move down the page.  Jock is correct it is easier to use the mailmerge function in WORD, but your user has to juggle between apps and select the right file to print from every time.  

Jim C.

RE: PCL printer commands to a LJ4... issues!!

Hi, Jim

Actually it is a bit more seamless than that.

I set up the mailmerge .doc file (e.g. Avery5160.doc) to default to the .csv file name which is generated by the clipper prog (avery5160.csv) and then in the clipper program run "start <path to winword.exe>\winword avery5160.doc".

That causes MS word to start in a separate window and open the mailmerge document. The operator just has to confirm the input file name (click on button) and then they are presented with a preview of the first page of labels. If they look ok then they just click on merge to print or merge to new document and it's done.

Jock

RE: PCL printer commands to a LJ4... issues!!

Jock,

I have got to get out more.  I end up relating this stuff to my systems, and forget that everybody isn't using a 20 year old system & structure.

Jim C.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close