Operating System - HP-UX
1823920 Members
3091 Online
109667 Solutions
New Discussion юеВ

how to create a default print header and footer

 
SOLVED
Go to solution
Martin Geil
Advisor

how to create a default print header and footer

I am trying to configure an HP-UX v11i system using HP Jetdirect and lpspool to have a default header and footer line on every page for any text file that is printed using "lp ". For example, I would like to have "Company XXX Proprietary Information" show up at the top AND bottom on every page of output. Implementing the header doesn't seem hard using "pr", but I'm having trouble with the footer. Any ideas?
Cogito Eggo Sum (I think, therefore, I am a waffle)
4 REPLIES 4
Steve Steel
Honored Contributor
Solution

Re: how to create a default print header and footer

Hi

If you expand the system variable MANPATH to include /opt/hpnpl/man you can use a man page for each script jetdirect offers.

Maybe instead of header and footer you should try the watermark options

Otherwise use the pr option -F and then pipe the pr output through sed to change the formfeed cntrlVcntrlL to the foot you want.

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Martin Geil
Advisor

Re: how to create a default print header and footer

Steve,

Thanks for the reply. Using pr and sed as you specified, I can generate printed output that meets my requirements. However, I would like to have the print formatting actually tied to the print queue as a preprocessor, rather than aliasing the "lp" command to my "pr | sed | lp" script. Any thoughts?
Cogito Eggo Sum (I think, therefore, I am a waffle)
Sundar_7
Honored Contributor

Re: how to create a default print header and footer

The scripts that actually send the output to the printer are in /etc/lp/interface. Have a look at those scripts. There could be some options for you to specify the header/footer.

If the script in /etc/lp/inteface/ is modified to include the header/footer, then you dont have alias lp command.
Learn What to do ,How to do and more importantly When to do ?
Martin Geil
Advisor

Re: how to create a default print header and footer

The above responses were very helpful. I did indeed end up modifying the scripts in /etc/lp/interface/model.orig (part of Jetdirect Printer Installer software). I added some logic so that plain text files would be run through "pr" to format a header, and "sed" to substitute a footer for the form-feed character. The same trick also worked on Solaris, although I had to specify /usr/xpg4/bin/pr, and had to change the script to execute in ksh. Thanks to everyone that responded!
Cogito Eggo Sum (I think, therefore, I am a waffle)