[Pkg-samba-maint] Bug#156531: I don't think that doing something for this samba bug is worth it

Christian Perrier bubulle at debian.org
Tue Apr 24 21:24:18 UTC 2007


tags 156531 wontfix
thanks

What's suggested in this bug report (put an example of a printer
producing PDF in smb.conf) sounds like user finetuning her
setup.

I don't think this pertains to the default provided smb.conf file.

Original bug report (more than 4 years old):

Please look at the scripts below and see if you want to include it
(commented out) in /etc/samba/smb.conf.  It looks very useful to
samba<->Windows users.

Simon

----- Forwarded message from Buchan Milne <bgmilne at cae.co.za> -----

Date: Mon, 12 Aug 2002 19:22:23 +0200
From: Buchan Milne <bgmilne at cae.co.za>
To: discuss at openoffice.org
Subject: Re: [discuss] PDF creation blues
Reply-To: discuss at openoffice.org

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gary Frederick wrote:
| Woo Hoo.
|
| I would like to have a pdf 'printer' on Windows so I can select that
| 'printer' and get pdf. I installed various parts to print pdf on XP and
| ran out of time. It's easier to print to pdf in a WebDAV location with
| Linux and then get it on Windows (usually :-))
|
| and...

Using a linux box is cheating, and in the case you have one, there are
easier ways. For example, use the attached script via samba using the
configuration below in your smb.conf to create a virtual printer. It
will send you a windows popup when your PDF is done. Of course, choose a
postscript printer driver in windows. If you are going to be setting
this up for multiple machines, upload a print driver to the server, so
users just have to double click (no "next" buttons to click even) to set
it up.

<plug>This will be available in the default setup of samba in Mandrake
9.0</plug>

Buchan

# From smb.conf
# Watch line breaks, there should only be 7 lines from here to end
[pdf-generator]
~   path = /var/tmp
~   guest ok = No
~   printable = Yes
~   comment = PDF Generator (only valid users)
~   #print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP &
~   print command = /usr/share/samba/scripts/print-pdf %s ~%u \\\\\\\\%L\\\\%u %m %I &
#end of smb.conf section

#!/bin/bash
# samba-print-pdf
# This is a script which allows you to set up a virtual printer on samba
# which will take the file (generated by a postscript filter on windows)
# and turn it into a PDF, informing the user of where it is when it
# is done
#
# Buchan Milne <bgmilne at cae.co.za> 20020723
#
# Arguments:
# $1 = file (usually passed with %s from samba)
# $2 = unix prefix to where to place the file (~%u should work)
# $3 = windows prefix to the same location (\\%L\%u should work)
# $4 = user/computer to send a notification to (%u or %m)
# $5 = IP address of client (%I)


PS2PDF=ps2pdf13 
OPTIONS="-dAutoFilterColorImages=false -sColorImageFilter=FlateEncode"
INPUT=$1
KEEP_PS=1
PERMS=640
INFILE=$(basename $INPUT)
BASEFILE=pdf-service

#make a temp file to use for the output of the PDF
OUTPUT=`mktemp -q $2/$BASEFILE-XXXXXX`
if [ $? -ne 0 ]; then
        echo "$0: Can't create temp file $2/$BASEFILE-XXXXXX, exiting..."
        exit 1
fi
                                                                        
WIN_OUTPUT="$3\\`basename $OUTPUT`"

# create the PDF:
$PS2PDF $OPTOINS $INPUT $OUTPUT.pdf >/dev/null 2>&1

# Generate a message to send to the user, and deal with the original file:
MESSAGE=$(echo "Your PDF file has been created as $WIN_OUTPUT.pdf\n")

if [ $KEEP_PS ];then
        mv $INPUT $OUTPUT.ps
        MESSAGE=$(echo "$MESSAGE and your postscript file as $WIN_OUTPUT.ps")
        # Fix permissions on the generated files
        chmod $PERMS $OUTPUT.ps
else
        rm -f $INPUT
        chmod $PERMS $OUTPUT.ps $OUTPUT.pdf
        # Fix permissions on the generated files
fi
                                                                
chmod $PERMS $OUTPUT.ps $OUTPUT.pdf

#Remove empty file from mktemp:
rm -f $OUTPUT

# Send notification to user
echo -e $MESSAGE|smbclient -M $4 -I $5 -U "PDF Generator" >/dev/null 2>&1



-- 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20070424/e51e5749/attachment.pgp


More information about the Pkg-samba-maint mailing list