[Samba] HOWTO Create a PDF Writer in samba

Buchan Milne bgmilne at cae.co.za
Tue Jul 30 09:38:02 GMT 2002

Hash: SHA1

| Message: 16
| Date: Mon, 29 Jul 2002 16:23:10 +0100
| To: Samba List <samba at lists.samba.org>
| From: Martyn Ranyard <ranyardm at lineone.net>
| 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
| it under GPL
| 1. install ghostscript (most distributions include it anyway)
| 2. put the following in the file /usr/sbin/pdfprint and make it
| by whatever your guest user for samba is :

Well, I just (last week) put a similar one into the Mandrake samba RPMs:

It could also be under the GPL. I reviewed all the comments that were
posted in the older thread, and this is the best option I came up with.
We use something like this in the smb.conf:

~    path = /var/tmp
~    guest ok = No
~    printable = Yes
~    comment = PDF Generator
~    print command = /usr/share/samba/scripts/print-pdf %s ~%u Z:\\ %m %I &
(& important, as it allows the file to be "spooled", since the smbd
doesn't wait for the process to return).

Since we write the pdf to their home directory (NFS mounted from our
file server), we don't allow guests. It also allows us to set better

| of course the permissions and file format can be altered depending on
| 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).

For convenience, my equivalent is provided by the caller, so the user
should only need to modify the smb.conf to change it.

| 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

Not a good combo of permisssions/group/user.

|          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.

How about uploading the printer driver to your samba server, so the
clients can use a downloadable print driver (ie double click on the
printer to set it up).

| 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.

P.S. For some users, it's handy to have postscript also, so we keep the
.ps file.

- --
|----------------Registered Linux User #182071-----------------|
Buchan Milne                Mechanical Engineer, Network Manager
Cellphone * Work            +27 82 472 2231 * +27 21 8828820x121
Stellenbosch Automotive Engineering         http://www.cae.co.za
GPG Key                   http://ranger.dnsalias.com/bgmilne.asc
1024D/60D204A7 2919 E232 5610 A038 87B1 72D6 AC92 BA50 60D2 04A7
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the samba mailing list