HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Configure printer to print to a file
Operating System - HP-UX
1828390
Members
3506
Online
109977
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
Forums
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
11-21-2003 02:24 AM
11-21-2003 02:24 AM
We have a legacy hpux application that creates reports that must be viewed on screen or printed to a printer. There is no option to save to a file. I am pretty sure the reports are in PCL, since we have to use laserjets. How can I set up a printer to print to a file instead of a device?
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2003 02:51 AM
11-21-2003 02:51 AM
Solution
The most straightforward way to do this is to create a named pipe for the lp device when you add the printer in the conventional way.
e.g. mknod p /dev/mylppipe
Now when you add the printer using SAM or lpadmin use /dev/mylppipe for the device.
That's half of the battle but now we need a daemon to actually read from the named pipe and send it to a file.
e.g.
typeset -i10 NN=0
while true
do
(( NN += 1 ))
OUTFILE="/mydir/fname${NN}"
cat /dev/mylppipe > ${OUTFILE}
done
This daemon a or a similar loop should be in an rc script to start automatically.
You might add some coding to make the filenames more meaningful -- such as a date/time stamp.
e.g. mknod p /dev/mylppipe
Now when you add the printer using SAM or lpadmin use /dev/mylppipe for the device.
That's half of the battle but now we need a daemon to actually read from the named pipe and send it to a file.
e.g.
typeset -i10 NN=0
while true
do
(( NN += 1 ))
OUTFILE="/mydir/fname${NN}"
cat /dev/mylppipe > ${OUTFILE}
done
This daemon a or a similar loop should be in an rc script to start automatically.
You might add some coding to make the filenames more meaningful -- such as a date/time stamp.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2003 02:51 AM
11-21-2003 02:51 AM
Re: Configure printer to print to a file
As a device is "simply" a file itself, when you set up the printer, you can use something like
lpadmin -pPRINTER -vFILE -mdumb
This will send the output to whatever the filename is that you specify.
lpadmin -pPRINTER -vFILE -mdumb
This will send the output to whatever the filename is that you specify.
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP