Operating System - HP-UX
1831912 Members
3720 Online
110031 Solutions
New Discussion

Re: Printing envelopes using lp

 
Patrol
Advisor

Printing envelopes using lp

I have two files with receiver and return addresses of an envelope to be created in the format of :

FirstName LastName
123 Street Name
City, ST zipcode

I need to print a nice and professional looking envelope from this data. The envelope is the plain COM10 format with no transparent window or anything. The print queue is defined on my hpux server and the printer type is HP LaserJet 8000.

The return address font point size should be considerably smaller than the recipient's address. The envelope will be fed from the manual paper tray. And user does not have to mess with any printer control button. He just needs to insert the envelope to the tray and printer should do the rest.

And this procedure needs to be put in a script that the user can run when he needs to print the envelope.

Is this too much to ask from the lp scheduler ? Should I send them to talk to the windows group ? As cryptic as lp related commands, I am not able to figure out how to do this.

Help is apprecited, with points proportional to the level of help.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Printing envelopes using lp

You are confusing the role of the spooler with that of an application. The spooler has absolutely no role in parsing data files and formatting text --- that is the exclusive role of an application in UNIX. You can specify options via -o to set the initial font, pitch, pagelength, etc. -- if the interface file supports these features but changes in font or pitch after a job start is the sole responsibility of the application. You could write a script that would insert PCL commands in the output stram to do all of this but this is really an application that is Duck Soup with a product like Word. Unless you have a compelling reason to do this in UNIX, Windows is well suited to this task. This would not be a difficult task in Perl, or shell (with some awk) but why bother?
If it ain't broke, I can fix that.
Patrol
Advisor

Re: Printing envelopes using lp

The only compelling reason to put this task into a script form is, these return and mailout addresses will be generated along with a letteras a result of a database query. I have no problem sending out the letter in plain text form to the printer with the default character set and default paper source selection.

If I need to send these people to the Windows guys, I need to find a way to transparently pass the from/to addresses along with the letter context on to the dark side. Cooperation from the dark side admins is neraly nil. If the task ends up in their hands, completion is too far away, and if it happens at all. So, I have my compelling reasons to keep the task in house, hpux house that is, if at all possible.

Is there a utility that I can use to generate the PCL output I want from the data I want, so that I can use it as a template and swap in and out the addresses using sed/awk or perl ?
A. Clay Stephenson
Acclaimed Contributor

Re: Printing envelopes using lp

Though it's not free, by far, the best product I have found to transform plain text into amazing documents is UnForm. (www.unform.com). It's overkill for this project but if you have possible others in the pipeline then I would get and use it. You can download a trial version. It may seem a little daunting at first but there are a number of samples. You can study the PCL documentation to do this for your envelopes but UnForm will do this in a snap.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: Printing envelopes using lp

You can indeed script the entire task but I would plan for several days or weeks to create the job. PCL is simple: it's plain ASCII with a bunch of escape sequences. BUt you'll need to learn all about page printers (not line printers) because you'll need to compute and move the starting position for each line. You'll also need to learn about fonts and spacing. The best way to learn about all this is from a PCL Technical Reference manual or one of the many PCL books on the market. Plan on using a lot of paper for testing (don't use envelopes until everything lines up).

As far as using Windows, you won't need all the PCL programming details because you can create a form in Word and import the required data. Making it automatic can be tricky if you don't know VBA or other PC-friendly languages.


Bill Hassell, sysadmin
Patrol
Advisor

Re: Printing envelopes using lp

Looks like I am up the creek without a paddle as I do not have neither days and weeks to invest in studying PCL, nor handing it to the windows team to totally abandon all hope. I was hoping for a very simple, one or two liner command to help me accomplish this but looks like I was dead wrong.

Thanks anyway