[Samba] Modified Cups Backed pdf writer to keep the original document
name.
Kurt Pfeifle
kpfeifle at danka.de
Fri May 16 10:37:27 GMT 2003
Matthew Western mwestern at affairs.net.au wrote on Samba-Digest
> Fri May 16 14:33:29 GMT 2003
>
>
> Hi All,
> I've got a samba/cups pdf writer going thanks to PeteFwee and Wolfram Q and
> a few others... the cups pdf backed i used has a default of
> username-date.pdf which I didn't like and wanted the name of the job that
> got send in the printer q on the winslows client.
>
> The only way I could see in my very limited experience was to grab the
> %%Title out of the postscript file and make sure that it didn't have any bad
> characters.
Hi Matthew,
the job title is passed to all filters and backends as $3 by CUPS. It is
my experience that it is more reliable to use this, because the %%Title
is more often not present than $3. The complete list of parameters provided
by CUPS to all filters and backends is this:
$0 -- printername
$1 -- job-ID
$2 -- username
$3 -- job-title
$4 -- printjob-options
$5 -- requested copies
$6 -- <filename>; empty if taken from 'stdin'
They may be picked up by self-rolled custom backends and filters to
use for their purposes.x
> I also did a few extra lines to send the .pdf to the person that sent it
> (thankfully that was already passed though).
>
> Here it is. I didn't use awk when i probably should of because i'm crap at
> regular expressions. Real programmers might have a laugh and my error
> checking is non-existant, but it worked for me and may be useful to some
> newbie out there somewhere....
>
> thanks goes to Michael Goffioul for writing the orginal script which i got
> from
> http://printing.kde.org/downloads/pdfdistiller and the how to posted
> originally to samba by Tom. i'd be interested in any feedback about how i
> should have used awk so i can learn. :)
Sorry for giving feedback on a not-asked question... ;-)
> Regards
> Matthew
>
Cheers,
Kurt
More information about the samba
mailing list