Operating System - HP-UX
1833589 Members
3693 Online
110061 Solutions
New Discussion

printer queue to print to a file

 
SOLVED
Go to solution
Unix Administrator_5
Frequent Advisor

printer queue to print to a file

Is it possilbe to setup a printer queue that will print directly to a file rather than a printer. We are using hpux 11.0.

Any tips on doing this?

Thanks,

Jon
6 REPLIES 6
Manish Srivastava
Trusted Contributor

Re: printer queue to print to a file

Hi,

setup the printer device as a file:

lpadmin -pprinter -v/tmp/file -m
this will print the contents to this file.

manish.
Anupam Anshu_1
Valued Contributor

Re: printer queue to print to a file

You can set the printer name as a . Doing this, lp will print to the file.

BTW, you can use cat(1) to do the same :-).

Anshu
Bruno Ganino
Honored Contributor

Re: printer queue to print to a file

Use lpadmin with option -v

(-vdevice associates a new device with printer P. Device is the pathname of a file that is writable by lp).

Bruno
Torino (Turin) +2H
KapilRaj
Honored Contributor

Re: printer queue to print to a file

/etc/lp/interface should hv some shell scripts (backends for printing). Edit that and change it accordingly so that it wrintes to a file rather than printing

Kaps
Nothing is impossible
Unix Administrator_5
Frequent Advisor

Re: printer queue to print to a file

The printer has to be a defined queue. A program will be sending to it.

The reason I need this is we have an application that sends pintjobs to various remote printers that run a certain printing software. It seems that the output at times is garbled. The tech. people of the printing software want to see the data as it comes out of the sending application. So, the best that we have come up with is to have a queue that will direct it's output to a file.

Thanks for the ideas so far. -- Jon
Jose Mosquera
Honored Contributor
Solution

Re: printer queue to print to a file

Hi Jon,

May be this idea looks crazy but think about it like an alternative.

All printer request go to a corresponding spool directory placed into /var/spool/lp/request/

Always two files are generated by each request. One of them is a header file (begin with c*) an other is data file (begin with d*). Both of then are associated by job-id.
So if you have a printer, always disabled, you can develop a script file that handle this files according with you criteria. Take note about that all data files (d*) are plain text, no scape sequences are included.

Rgds.