This site is now 100% read-only, and retired.

Printing PDF to your samba home share

Posted by gna on Fri 22 Apr 2005 at 08:38

Tags: none.

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.

 

 


Re: Printing PDF to your samba home share
Posted by Anonymous (212.39.xx.xx) on Fri 22 Apr 2005 at 11:57
How is that different from "apt-get install cups-pdf"?

[ Parent ]

Re: Printing PDF to your samba home share
Posted by gna (212.40.xx.xx) on Fri 22 Apr 2005 at 12:51
[ View Weblogs ]
In Debian/Stable, you don't have the package cups-pdf.
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 ]

Re: Printing PDF to your samba home share
Posted by Anonymous (82.92.xx.xx) on Thu 15 Jun 2006 at 12:18
Officially you should be able to set the output directory in /etc/cups/cups-pdf.conf using the "Out" option.

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 ]

Re: Printing PDF to your samba home share
Posted by Anonymous (82.92.xx.xx) on Thu 15 Jun 2006 at 12:43
Replying to myself: seems this is not yet implemented in the current version of cups-pdf that is included in debian stable.

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 ]

Re: Printing PDF to your samba home share
Posted by Anonymous (212.43.xx.xx) on Fri 22 Apr 2005 at 13:16
well the article does mention that you only need to get the source if you're running woody.

[ Parent ]

Re: Printing PDF to your samba home share
Posted by Steve (82.41.xx.xx) on Fri 22 Apr 2005 at 14:06
[ View Weblogs ]

Although to be fair using -O9 is pretty insane - anything above -O3 is overkill.

Steve
-- Steve.org.uk

[ Parent ]

Re: Printing PDF to your samba home share
Posted by gna (212.40.xx.xx) on Fri 22 Apr 2005 at 15:06
[ View Weblogs ]
:), I didn't knew, so maybe i shall report this to Mr. Behr?

[ Parent ]