Operating System - Linux
1828578 Members
2714 Online
109982 Solutions
New Discussion

start a script over printing via cups

 

start a script over printing via cups

Hey professionals,

I would like to have a printerqueue who only converts PS into PDF. I added a printer in CUPS who generates me the PS - File in /tmp/xxx. That works fine. Then I wrote a script with converts my PS into PDF - This works fine, too.
My Problem is: The script must be started, as soon as a User prints to the printerqueue.

Solve this with cron occurs me badly.
Now my Idea: cups should invoke the script after the PS - File is generated. I tried some badly solutions like modifying the ppd - file from the queue ( insert like `touch /tmp/test`) and so on, but nothing was working.

Any ideas?


Many thanks in advance

Alex

PS: using RH 9.0 on xw4100; working greatly
2 REPLIES 2
Huc_1
Honored Contributor

Re: start a script over printing via cups

I do not know if I understant this completely?, but why not try using an alias for lp "cups"
like
my_script
do this
do that
print using cups

in the user profile
alias lp=my_script

or am I not undrstanding your question ?

J-P (Jean-Pierre)
Smile I will feel the difference

Re: start a script over printing via cups

Hey J-P,
thanks for your reply.

This would work if I had only UNIX - Users, but I will also print from other systems - so I can´t use aliases.
( the printerqueue didn´t recognize the user )
I need an solution who starts my script "after" the lp - command was given and the PS - File was generated.

I was thinking about a while ... true loop
( eg. analyze ll /tmp/$psfile ) - but this continuous loop is sellout...

So I intend to do that with the spoolersystem.

Any ideas how to implement an shellscript, eg. in the modelscript?

Alex

PS: I attached the ps2pdf - script, maybe someone is intereste