[Samba] naming the pdf output file

Christopher Odenbach odenbach at hni.uni-paderborn.de
Mon Nov 25 10:36:01 GMT 2002


Hi,

>  > when creating a pdf  file with samba i use
>  > /usr/bin/printpdf %s %U as the print command.
>  > So far everything works fine and the pdf has the same name as the
>  > user.
>  >
>  > But is there any way to use the name of the print job as shown in
>  > the print manager of windows ?
>  > This would mean that when the user prints a file called A0029.xls
>  > the output would be called A0029.pdf
>
> Assuming the printerdriver produces postscript you could actually
> extract the title (%%Title: ..... ) using grep from the spoolfile
> (%s) and use that as a basis for the pdfname.

Better: Use the %J parameter - you can find the jobname there. Then 
write a small script that calls printpdf and renames the output file. 
Remember quotes!

Christopher

-- 
======================================================
    Dipl.-Ing. Christopher Odenbach
    HNI Rechnerbetrieb
    odenbach at uni-paderborn.de
    Tel.: +49 5251 60 6215
======================================================



More information about the samba mailing list