June 8, 2009

Shared Samba Printer for PDF/PS Storage

As many of you already know I'm experiencing some sort of hylafax/samba integration for a mixed Windows environment, this blog is for creating a PDF/PostScript printer easily, no matter of what you do with the printer; when you print on it you'll produce a Postscript/PDF document

requirements:
A samba server installation up and running

achievements:
Create a PostScript/PDF document from a spool so every Windows user in your net can generate documents without client side software installation (Exception for the windows printer driver)

notes:
If you want to create your PDF files and customize them each time (custom passwd protection, comments, tags) you'd probably use PDFCreator, it has a windows installation and a lot of funny options to deal with. If you're searching for a dumb massive pdf generation for average windows users (lazy users without knowledge and time) you'd better stay here to see my config.

I'm using it for a Windows network where users just need to use a document management and storage system, they simply want to archive files on storage array in PDF format, no matter for file input (DOC, XLS, EMails, ...). This is particularly useful in big environments and when input file may vary, here's a nice Windows spooler usage

After installing samba and integrating it in your network (Workgroup, Domain, Active Directory, ... need some help or need a new blog for it ?) just add a section to your /etc/samba/smb.conf (or wherever your samba config file is) like this one:

# SAMBA PDF SHARED PRINTER 
# for windows clients
[pdfprinter]
comment = my cool samba printer
public = yes
print command = ( ps2pdf "%s" "/my/storage/dir/`date +"%Y-%m-%d.%H-%M.pdf"`" > /dev/null; rm "%s" ) &
printable = yes
writable = no
path = /var/spool/samba
use client driver = yes

This config was taken from a running server, exception for the print command line, in my case I've a custom script making other things, in this sample when a file is received it will be converted from PS (input) to PDF (output) and temp PS file is then deleted.

PDF in the example will have this name /my/storage/dir/YYYY-MM-DD.HH-MM.pdf
change it to whatever you want

 

Now the big question is: what should I have to install on the windows side ?
Here's the easiest part of the trick.
Install a "Apple LaserWriter 12-640 PS" printer, common alternatives are:
"Apple LaserWriter 12-600 PS"
"HP Laserjet 4/4M PS"

I strongly suggest you to install Apple Laserwriter printer family, these are already supported and driver already available in Windows XP, You don't even need to supply Windows install CD

Vista users may choose HP Laserjet (no cd required, already installed), Laserwriter drivers are not there

These printers are PostScript printers so each file you send to them will be translated to postscript language (thanks to Windows Printer Spooler).

 

I use this system to store files in a common and unique format (PDF) in a mixed environments when different types of files exists and problems are raised when you only need to read a simple document

Hope it helps
Glad to read your comments

 

Andrea Ben Benini

Click Here!