[Samba] HOWTO Create a PDF Writer in samba

Freeman, Peter (ERHS) Freeman.Peter at saugov.sa.gov.au
Mon Jul 29 21:29:02 GMT 2002


Hi Martyn

I'm currently attempting to set up the same kind of thing, however
I'm using CUPS as the printing system and it ignores the "print command"
parameter.  At the moment I have a pdf print share set up, and I can
print to it, but the PS file doesn't convert to pdf (I can do it manually
from the CL and it comes out fine)

I take it you used lpd?  Does anyone on the list have pdf writing working
with CUPS as the printing system??

TIA

>-----Original Message-----
>From: Martyn Ranyard [mailto:ranyardm at lineone.net]
>Sent: Tuesday, 30 July 2002 12:53 AM
>To: Samba List
>Subject: [Samba] HOWTO Create a PDF Writer in samba
>
>
>
>Hi all,
>
>   Thought I'd post this to the list as I found a better way of doing 
>it.  Nice to have for posterity.
>   Please include it in the source of samba if you wish - I 
>hereby license 
>it under GPL
>
>1. install ghostscript (most distributions include it anyway)
>2. put the following in the file /usr/sbin/pdfprint and make 
>it executable 
>by whatever your guest user for samba is :
>
>#!/bin/bash
>#convert to pdf $1 = spool file $2 = uid $3 = gid $4 = 
>machinename $5 = ip
>FILENAME=pdf-$2-`date +%d%m%H%M%S`.pdf
>OUTPUTPATH=/mnt/raid/topdf
>echo converting $1 to $FILENAME for $2 of machine $4... >> 
>$OUTPUTPATH/pdfcreate.log
>/usr/bin/ps2pdf $1 $OUTPUTPATH/$FILENAME >> 
>$OUTPUTPATH/pdfcreate.log 2>> 
>$OUTPUTPATH/pdfcreate.log
>echo conversion finished, removing $1 >> $OUTPUTPATH/pdfcreate.log
>rm $1
>echo done, setting permissions and notifing user >> 
>$OUTPUTPATH/pdfcreate.log
>chown $2:$3 /mnt/raid/topdf/$FILENAME >> $OUTPUTPATH/pdfcreate.log
>chmod 700 /mnt/raid/topdf/$FILENAME >> $OUTPUTPATH/pdfcreate.log
>echo your new PDF is called $FILENAME. | smbclient -M $4 -I $5
>echo All done. >> $OUTPUTPATH/pdfcreate.log
>echo >> $OUTPUTPATH/pdfcreate.log
>
>of course the permissions and file format can be altered 
>depending on your 
>system, but make sure that as these files are created by the 
>guest user, 
>that the directories referenced (spool dir and OUTPUTPATH) are 
>writable by 
>nobody (or whatever your guest user is).
>
>3. edit your smb.conf file and add something like the following :
>
>[pdfwriter]
>         path = /var/spool/samba
>         guest ok = yes
>         browseable = yes
>         printable = yes
>         read only = no
>         force group = root
>         force user = root
>         force create mode = 0777
>         print command = /usr/sbin/pdfprint %s %U %G %m %I
>
>Yet again, the permissions I have arrived at via 
>trial-and-error and are 
>more than a little insecure :)
>
>4. restart samba
>
>root at linuxsambaserver:~# killall -HUP smbd ; killall -HUP nmbd
>
>NB this apparently is not the way to do it on anything other 
>than Linux!
>
>5. Assign a postscript printer to the pdfwriter printer - Apple Color 
>LaserWriter 12/600 works well for me on NT4, but Adobe do a 
>free (small F) 
>printer driver, which also works well.
>
>6. Print.  You should get a message (NT/2K/XP/9x with 
>winpopup) informing 
>you of the name of your file.
>
>Hope this helps someone.
>
>
>Martyn Ranyard
>Free Software Advocate
>
>jabber - joran at amessage.de
>icq    - 122500800
>irc    - Joran on oftc
>msn    - ranyardm at hotmail.com
>e      - ranyardm at lineone.net
>
>
>-- 
>To unsubscribe from this list go to the following URL and read the
>instructions:  http://lists.samba.org/mailman/listinfo/samba
>




More information about the samba mailing list