- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Formatting LPR print jobs
Operating System - HP-UX
1821985
Members
3436
Online
109638
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2002 11:19 AM
08-23-2002 11:19 AM
Formatting LPR print jobs
I'm running HP/UX 11.0 and have a question about LPR printing. I want to embed options, parameters, escape sequences, or whatever, so that all jobs are formatted landscape and 8 lines per inch.
I can do this with the following command:
lp -d -olandscape -olpi8
but since I always want these settings, I want to make the changes at the queue/interface level.
I have been successful at this when using JetDirect printers. I do this by modifying the /etc/lp/interface/ file on my server by appending the options I want to the $5 parameter (options="landscape"$5). This works for an HP LaserJet 4100 printing via JetDirect.
I have another 4100 that is a remote printer to my system, so the /etc/lp/interface/ file is different, and I don't know how to add thse changes. If I use the same lp command as above, it is successful in altering the output. However, I don't know how to change the interface script for the remote printer as I have done for the JetDirect printer.
I did discover that the options are passed to the interface script in the $5 parameter, but they are NOT passed in the call to rlp, so something is using that value before the interface script gets control. I also found that the remote job gets two files in /var/spool/lp/request/. One is named dA, which contains the data. The other is cA, and in this file is a line with Olandscape. So, appearently something in the spooler subsystem creates this file and includes the options _before_ control is passed to the interface script.
Now that I've rambled on about that, what is the best way to accomplish what I want? I've thought about adding the escape sequences for the commands somewhere in the interface script, but I don't know where to put it nor what the syntax is. Thanks in advance to anyone who can help.
I can do this with the following command:
lp -d
but since I always want these settings, I want to make the changes at the queue/interface level.
I have been successful at this when using JetDirect printers. I do this by modifying the /etc/lp/interface/
I have another 4100 that is a remote printer to my system, so the /etc/lp/interface/
I did discover that the options are passed to the interface script in the $5 parameter, but they are NOT passed in the call to rlp, so something is using that value before the interface script gets control. I also found that the remote job gets two files in /var/spool/lp/request/
Now that I've rambled on about that, what is the best way to accomplish what I want? I've thought about adding the escape sequences for the commands somewhere in the interface script, but I don't know where to put it nor what the syntax is. Thanks in advance to anyone who can help.
- Tags:
- lp
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2002 05:18 PM
08-23-2002 05:18 PM
Re: Formatting LPR print jobs
Welcome to the world of SysV printing versus BSD. lpr is a BSD command (HP-UX doesn't have an lpr command...OK, there is a lame script that tries to emulate the front end). Anyways, BSD defines printer features in the printcap file (non-existant in HP-UX) and all formatting is complete before the job leaves the computer.
SysV actually did not define remote printing at the beginning so along came RFC 1179 to define how to send print jobs and just to be different, SysV defined print job numbers as 4-digits while BSD defines only 3-digit print jobs. Hence the lpadmin (and SAM) option for BSD.
But that's the easy part. The hard part is a primary functional difference between BSD and SysV printing: BSD completely formats the job before it leaves, while SysV requires that the remote side understand the -o control file options. In other words, the remote machine must do all the formatting, not the local one.
Oops, that's a show stopper. If that remote printer is on a toy (I mean PC) computer, there is nothing in the lpd code to process any -o options from HP-UX. Now if the remote computer is HP-UX, there is no problem since the remote HP-UX system will handle the -o options just fine.
So what to do? Well there is an easy choice, a medium choice and a hard one. The hard one is to create an lp wrapper script that is based on an existing model script. With a fair amount of scripting, it can accomplish the formatting and send the job correctly formatted to any remote print server.
The medium choice is to get another HP-UX machine to replace the remote server. Your HP sales rep can help you with that choice.
Or the easy way (you already know this one): pull out the other 4100 and stick a JetDirect card in it. Now everything will work fine.
Bill Hassell, sysadmin
SysV actually did not define remote printing at the beginning so along came RFC 1179 to define how to send print jobs and just to be different, SysV defined print job numbers as 4-digits while BSD defines only 3-digit print jobs. Hence the lpadmin (and SAM) option for BSD.
But that's the easy part. The hard part is a primary functional difference between BSD and SysV printing: BSD completely formats the job before it leaves, while SysV requires that the remote side understand the -o control file options. In other words, the remote machine must do all the formatting, not the local one.
Oops, that's a show stopper. If that remote printer is on a toy (I mean PC) computer, there is nothing in the lpd code to process any -o options from HP-UX. Now if the remote computer is HP-UX, there is no problem since the remote HP-UX system will handle the -o options just fine.
So what to do? Well there is an easy choice, a medium choice and a hard one. The hard one is to create an lp wrapper script that is based on an existing model script. With a fair amount of scripting, it can accomplish the formatting and send the job correctly formatted to any remote print server.
The medium choice is to get another HP-UX machine to replace the remote server. Your HP sales rep can help you with that choice.
Or the easy way (you already know this one): pull out the other 4100 and stick a JetDirect card in it. Now everything will work fine.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP