Printing PDF to your samba home share
Posted by gna on Fri 22 Apr 2005 at 08:38
There are many solutions for printing PDF documents which cost money, and which not. But with all these solutions, you can do this on your own computer. But what to do if one needs this in a centralized way?
If your users have a samba server, you only need GhostScript and CUPS, and a little engine named cups-pdf.
The GS, and CUPS packages and their dependecies exist in stable, the cups-pdf engine only beginning with testing, or unstable distributions.
If you're running stable you don't need to mix, instead you could compile it from source.
Once you installed the mentioned packages, and have a working samba (which defaults to CUPS as print-processor), you only need to have a complier, and get the cups-pdf source from here.
Extract the source, and edit the src/cups-pdf.h.Be sure to have the directory for the spool ready (default is /var/spool/cups-pdf), and change the output directory (CPOUT) to "$HOME". Maybe you will also wish to change the CPHOMESUB setting also, but it is not necessary.
After that you can compile cups-pdf with:
gcc -O9 -o /usr/lib/cups/backend/cups-pdf cups-pdf.c
This puts the cups-pdf backend in the right place.
Then you should copy and gunzip the extra/PostscriptColor.ppd.gz to the file /usr/share/cups/model/PostscriptColor.ppd
Finally you need to restart cups
Add a printer (maybe with the admin interface on http://localhost:631/ ) named pdfprint with the following details:
device: Virtual Printer (PDF Printer) make: PostScript model: generic postscript color printer...
Now edit your smb.conf, and add a printer named pdfprint
[pdfprint] printable=yes comment=Print to PDF path=/tmp create mask=0700
Reload samba by running /etc/init.d/samba restart.
Now you have a printer share called pdfprint, and when you print to it with a PS printer driver you get your PDF file produced and left in your home directory.
I collected this informations mainly from here. Respect to the author Volker C. Behr.
[ Parent | Reply to this comment ]
I don't tried the package, because i need to have a clean woody.
And you have the possibility to choose your spool-dir/destination-dir, and for example the PDF version.
Do you have these choices in the package?
If yes, please feel free to extend my document how it can be done using the package.
All ideas are welcome.
[ Parent | Reply to this comment ]
But it seems that debian has changed the location of that file in its package, and I can't get cups-pdf to abide by my settings. This seems a very stupid thing to do, so it's probably me doing something wrong, but at the moment I can't find what.
Very frustrating.
[ Parent | Reply to this comment ]
If you want to use it, this could be a way:
1. remove the current cups-pdf installed: apt-get remove cups-pdf
2. change sources.list to point your SRC (!!) repository to testing
3. get the source for the testing version: apt-get source cups-pdf
4. reset the sources.list to old
5. get the dependencies needed to compile it: apt-get build-dep cups-pdf
6. go to the base dir where the sources are (not the src dir inside) and make the .deb: dpkg-buildpackage -rfakeroot -uc -b
7. go up a dir and install the .deb: dpkg -i cups-pdf_2.2.0-1_i386.deb
and it should work (I think)..
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
Although to be fair using -O9 is pretty insane - anything above -O3 is overkill.
Steve
-- Steve.org.uk
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]