Operating System - HP-UX
1830820 Members
2760 Online
110016 Solutions
New Discussion

Re: Question about set a printer on a HP-UX server

 
SOLVED
Go to solution
Gary L
Super Advisor

Question about set a printer on a HP-UX server

Hi

I got a requirement today. Customer wanna setup a special printer queue on a rp5470 box (OS: HP-UX 11i v1). They require this print could "print" file to a specify PC's specify folder (c:\printer1).
Is it possible? If so, how to set it up.

I know how to setup a dummy printer on HP-UX system and let the print out goes to /dev/null.
lpadmin -pprinter_name -mdumb -v/dev/null.

Any answers will be very appreciate.

-G
9 REPLIES 9
Tim Nelson
Honored Contributor
Solution

Re: Question about set a printer on a HP-UX server

You want an HPUX defined printer to print the output onto a remote PCs drive c:\ ???????

Gary L
Super Advisor

Re: Question about set a printer on a HP-UX server

Hi Tim

Thanks for your fast reply (whin 10 sec).
Yes, It's my customer's requirment:

Please setup a printer on A (rp5470), let it prints a file to PC workstation B's c:\printer1.

Does it make sense?
Paul Sperry
Honored Contributor

Re: Question about set a printer on a HP-UX server

if you just wnat to "move" output files from hp-ux to a pc I'd look into samba/cifs
Tim Nelson
Honored Contributor

Re: Question about set a printer on a HP-UX server

Interesting request.

Idea #1: Install remote print spooler software on PC. Configure printer to print to file. Then set-up HPUX to print to this remote printer.

Idea#2: Set-up HPUX to print to file ( gonna have issues with format and printer codes CR/LF ) Share that filesytem to the PC via SAMBA/CIFS or the reverse and share the PCs disk with HPUX.

Idea#3: Get real creative, set-up HPUX to print to file ( somehow fix all the format issues) then email file to PC

The setup of the HPUX printer to a file will have to be done by hacking the print driver file /etc/lp/interface/myprinter.


Tim Nelson
Honored Contributor

Re: Question about set a printer on a HP-UX server

Fyi,

Simple way to send print job to a file on HPUX.

lpadmin -pPRINT2FILE -mdumb -v/dev/null
accept PRINT2FILE
enable PRINT2FILE

edit /etc/lp/interface/PRINT2FILE
Somewhere near the top add:
exec > /path/to/printfile

Then start the spooler.


Gary L
Super Advisor

Re: Question about set a printer on a HP-UX server

Hi Paul

Thanks for your suggestion. But, it doesn't match customer's requirment if through SAMBA or FTP.

But anyway, thanks a lot.

-G
Gary L
Super Advisor

Re: Question about set a printer on a HP-UX server

Hi Tim

Thanks for your good suggestons.
I'd like to try idea #2 and #3. I prefer #2 but if customer doesn't like SAMBA, if will try email way.

BTW, is it correct below. I wanna set a dummy printer queue, let the output file goes to the file /tmp/printer2file folder

# lpadmin -pPRINT2FILE -mdumb -v/tmp/printer2file
Tim Nelson
Honored Contributor

Re: Question about set a printer on a HP-UX server

Nope.

lp wants to see a real device file. You might be able to set up some type of FIFO and then have a script read the info in as it is sent into the fifo but now I am stretching the ideas.

I would stick with the modification of the interface file. You could change the exec > /path/to/file to a more robust config.
(I did not test this)
ii=0
outfile=/mydir/fyfile
while [[ -f $outfile.$ii ]]
do
(( ii = ii + 1 ))
done
outfile=$outfile.$ii
exec > $outfile
...
(the rest of the interface file))

then every minute or so have a script watch the directory and email all files to user, then delete files when done ??


Anand Sreenivasan
Regular Advisor

Re: Question about set a printer on a HP-UX server

We have this set in our environment today. You need to install WINLPD on the PC which has the printer and once you have a static IP address for that PC. simply add a printer in HP as a remote printer with that IP. It has been working quite well for our site .