General
cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect the printer out put to seperate filesystem on hpux 11.31

Origin Energy
Occasional Contributor

Redirect the printer out put to seperate filesystem on hpux 11.31

Hi

We have configured the printer on hpux11.31 and we need to redirect the out put to a separate file system Ex: In widows word "Print to a file") and the ouput has to save as a file in rdi format on that file system becasue we need to send these files to other location for chaning the logos and billing information(Customizing the bill).

I appreciate your help.

Thanks & Regards
Venugopal
9 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

For Unix, usually all printer output comes from a file or pipe, so there is no need to put it back in a file.

>the output has to save as a file in rdi format

Do you have a program to convert text to this rdi format? You may want to invoke this program directly, rather than deal with a printer at all??

So it seems you want a pseudo printer with a model script that first converts it into rdi format and then moves it do another filesystem to act as a staging area??
Bill Hassell
Honored Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

> rdi format

Rainfall Dependent Infiltration?
Recommended Daily Intake?
http://www.acronymfinder.com/RDI.html

OK, Ms. Google has provided the details: device-independent bitmap (RIFF RDIB format).

This is a very specialized file format and there is nothing in HP-UX that can do the conversion. It is especially complicated because the original data must be converted into a raster (bitmap) format, similar to the Windows GDI standard.

So you can create a custom script in HP-UX to send the output for a printer to a file but now you have to convert it, and for that you'll need a Windows box with the specialized software needed to convert this unusual format.


Bill Hassell, sysadmin
venu_panguluri
Occasional Visitor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

Hi

Thank you very much for your help
The senarios is we need to take a Customer Invoice print out (RDI format - as file) from SAP Application and then we need to send this file to stream serve application for changes in invoice(Logo of company, billing address ...etc). For this we have configured the local printer on HPUX 11.31 but there is no physical printer which should be attached to the server.

Now we are able to see the files(when we fire the print job through SAP application) in /var/spool/lp/request// but these file locations needs to change it to other file system(NFS mount) so that the stream serve application will do the necessary changes on that file.

For this, how can we change the spool directory path to other filesystem(nfs mount).

I appreciate your help on this.
Regards
Venugopal
Bill Hassell
Honored Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

So SAP has done the conversion so the file sent to the printer is already converted. That's good and you are correct, the file to be printed has been copied to the request directory so you can simply disable the printer and the files will pile up. You can then use NFS or CIFS (SAMBA) to share the files with another system. Once the files have been handled, it would be a good idea to cancel each print request. Removing the files via NFS/CIFS may confuse the spooler.

Or you can simply write a printer script that copies the file to a specific location (your NFS/CIFS location) and by ending normally, the spooler will treat the file as printed.


Bill Hassell, sysadmin
OldSchool
Honored Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

> Bill H: "Or you can simply write a printer script that copies the file to a specific location (your NFS/CIFS location) and by ending normally, the spooler will treat the file as printed."

yep...its not that hard to do. and once done, its cleaner to maintain
Bill Hassell
Honored Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

Attached is a very basic lp script that can be used to redirect the output to another location. When the script completes with a zero exit code, the lp spooler will remove the queued print job.


Bill Hassell, sysadmin
venu_panguluri
Occasional Visitor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

Hi

Thank you very much for your help.

Is there any way to copy print files directly to another file system (it means change the spool directory when we are creating the printer - direct nfs filesystem)
with out copying manually becasue it will keep on generate files every second.

I appreciate your help.

Regards
Venugopal
Bill Hassell
Honored Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

> Is there any way to copy print files directly to another file system (it means change the spool directory when we are creating the printer - direct nfs filesystem)
with out copying manually becasue it will keep on generate files every second.

Just create an NFS mountpoint at /var/spool/lp/request. Note that NFS can be a major bottleneck unless you have a fast link (1000Mbit) between both computers and your client is very fast. If your HP-UX system is busy with other printers, it would be wise to set the mountpoint to /var/spool/lp/request/rdi_printer_name.


Bill Hassell, sysadmin
OldSchool
Honored Contributor

Re: Redirect the printer out put to seperate filesystem on hpux 11.31

"Is there any way to copy print files directly to another file system (it means change the spool directory when we are creating the printer - direct nfs filesystem)
with out copying manually becasue it will keep on generate files every second."


I think you missed Bill H's original point. "Or you can simply write a printer script that copies the file to a specific location (your NFS/CIFS location) and by ending normally, the spooler will treat the file as printed."

there is no "manual" copying involve. lp, when the job is sent to the appropriat printer, will copy the file specified (instead of actually printing it.

The script he attached is a good starting point. substitue "cp" for "cat" (and similar changes) would be required.