[Samba] naming the pdf output file

Hubertus Hiden hidden at netway.at
Mon Nov 25 11:10:01 GMT 2002


René Nieuwenhuizen schrieb:

> Christopher Odenbach heeft geschreven:
>
>> 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!
>>  
>>
>
> Great! If been running my own postscript analysis scripts for years 
> now but this makes life a lot easier...
>
> Thanks for redirecting me at the documents again....
>
Thanks for both solutions !





More information about the samba mailing list