1834928 Members
2767 Online
110071 Solutions
New Discussion

Print to a file

 
SOLVED
Go to solution
Frank Solberg
Occasional Advisor

Print to a file

Hi,
Is it a easy way to configure a printer on hpux which prints to a file (pdf format) ?
8 REPLIES 8
Stefan Farrelly
Honored Contributor

Re: Print to a file


no, its not easy, and in fact I think its impossible (to a pdf format anyway).
Im from Palmerston North, New Zealand, but somehow ended up in London...
MANOJ SRIVASTAVA
Honored Contributor

Re: Print to a file

Hi frank


The best way is to have an ascii dump and then ftp to a PC and then change the format to whatever you desire , as Unix primarily is good in processing rather tahn formatting.

Manoj Srivastava
V. V. Ravi Kumar_1
Respected Contributor

Re: Print to a file

hi,
i think it is impossible.

Never Say No
Sean OB_1
Honored Contributor

Re: Print to a file

I don't think there is anyway to save it as PDF. Possibly as a postscript file, and definetely as an ascii file.

Steve Steel
Honored Contributor

Re: Print to a file

Hi

The ascii to PDF conversion was discussed recently.

see

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x0b1f4b3ef09fd611abdb0090277a778c,00.html


First try the solutions shown and if 1 works for you then put it in the dummy printer scripts.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Rich Wright
Trusted Contributor
Solution

Re: Print to a file

No, it is not easy. But it will be an adventure.
The pdf part makes it a little more difficult.

You will need to get a ps to pdf conversion utility.
See http://www.ps2pdf.com or search in http://hpux.cs.utah.edu

Then create a print queue using an existing laserjet printer if you can.

Copy /usr/spool/lp/model/postscript to /etc/lp/interface/model.orig/
Edit the /etc/lp/interface/ script changing the line that says "$REALMODEL ..." replacing "| $HPNPF ..." with a ps2pdf filter directing output to a file.

It will be a lot easier if you can get a pdf conversion utility that takes ascii input.
Then you can create a "dumb" printer.
lpadmin -p -mdumb -v/dev/null
which will only produce the /etc/lp/interface/ script file.
Then you can modify it to do what you want.

Here is a summary of the variables that the spooler passes to the /etc/lp/interface/ script.
$1 = Job
$2 = User Name
$3 = Title
$4 = Numb. Copies
$5 = Options
$6 and up = files to print

Good Luck,
Rich

Gregory Fruth
Esteemed Contributor

Re: Print to a file

Ghostscript comes with a ps2pdf utility; perhaps you
can start with that.

http://www.aladdin.com/
http://www.ghostscript.com/
http://www.cs.wisc.edu/~ghost/

If you're starting with ASCII text, you'll want GNU
enscript or somesuch to convert your text from ASCII
to Postscript.

The trick is in writing the appropriate printer interface
script. You can probably arrange for the user to
supply the filename via a "-o" option. Then you'll
have to deal with file ownership and permissions.

HTH

Roger Baptiste
Honored Contributor

Re: Print to a file

hi,

I do it through the acrobat reader. In this case, no need for any special configuration for the printer.

Hope i understood your question ;-)

-raj
Take it easy.