[Samba] Printing with CUPS and PDF

Kurt Pfeifle kpfeifle at danka.de
Mon Mar 31 21:19:44 GMT 2003


> Tom samba-lists at fleet.ucdavis.edu wrote on Samba-Digest:

> Mon Mar 31 11:57:58 GMT 2003
> 
> 
> Everything goes smoothly with the installation... drop 'pdfdistiller' 
> into /usr/lib/cups/backend,

I hope you didn't use "copy'n'paste" from your browser, but "Save as..."
to get it?

> chmod +x, restart cups service. Add a 
> printer in cups with:
> 
> 'lpadmin -p PDF -E -v pdf:/tmp/'
> 
> ...and voila! Nothing happens.

Of course not. You have not yet associated a PPD with it, which means you
are running it as a "raw" printer.

> Doesn't give any errors, but it won't 
> print ('lpr -P PDF foo.ps'). Delete the printer ('lpadmin -x PDF'), 
> download distiller.ppd (found here: 
> http://www.pentondigitalads.com/downloads/adist4.zip). Copy new ppd file 
> to /usr/share/cups/model. Re-add printer with:
> 
> 'lpadmin -p PDF -E -v pdf:/tmp/ -m distiller.ppd'
> 
> ...and there we go! Still nothing prints. :(

OK.

Did you re-start cupsd after dropping the "distiller.ppd" into
"/usr/share/cups/model/" ? This is required to allow CUPS to rebuild
its cache of available PPDs from that directory. Only if there is a
valid cache, you can install the PPD using the "-m" parameter without
the path.

Otherwise use the absolute path; then you don't need to re-start cupsd
after updating your PPD "model" directory:

   'lpadmin -p PDF -E -v pdf:/tmp/ -P /usr/share/cups/model/distiller.ppd'

Do you see a "/etc/cups/ppd/PDF.ppd" ?

To check if CUPS is recogizing the newly available backend, let root run

   "lpinfo -v"

and grep for "pdf".

To check if it basically works as a backend, first run it with no arguments:

   "/usr/lib/cups/backend/pdfdistiller"

and it should output

   'direct pdf "Unknown" "PDF Writing"'

Then run it with a wrong number of arguments (use 1, 2, 3, or 4 dummy arguments)

    "/usr/lib/cups/backend/pdfdistiller 1 2 a b"

and it should output

    "Usage: pdf job-id user title copies options [file]"

The PDF should go to "/tmp/", according to your installation. Backends are running
as root, and for paranoid security you may not want to write files as root into
"/tmp/". Better use a separate directory with access rights you need:

    "lpadmin -p PDF -E -v pdf:/home/username/pdfs/ -P /usr/share/cups/model/distiller.ppd"

Further, the script relies on "ps2pdf" to be present on your system. Do you get
an answer to this:

    "which ps2pdf"

Last: If you want to get some more debugging info into the CUPS error_log
(in "/var/log/cups/error_log"), insert this line

    "set -x"

into the "pdfdistiller" as the right after the first line. Set cupsd.conf
to "LogLevel debug" and re-start cupsd.

> I dig the simplicity of the solution at
> http://printing.kde.org/downloads/
> but given that it doesn't seem to work for me, I can hardly recommend 
> it.

You don't need to recommend it -- *I'll* be doing it...   ;-)

> Perhaps I'm missing something. Is there any documentation out there 
> that's more in depth than the pdfdistiller file itself and this thread?

Hmmm... I just checked and the detailled README I once put there has
gone. Need to dig it out again.

> Thanks to all who responded to the original post!
> 
> -Tom
> 
> Kurt Pfeifle wrote:
> 
>> This is only *one* of the many options to create a "PDF printer". It is
>> geared towards working with a legacy, old-fashioned spooling system.
>> It will only serve your Windows clients. Should you need to support
>> Unix/Linux/MacOSX clients too with your print server, you'd need to set
>> up a separate PDF printer for these type of clients.
>> 
>> A better way to set up a PDF generation service for print clients is to
>> use the PDF creating CUPS "backend" as provided on
>> 
>>    http://printing.kde.org/downloads/
>> 
>> You need the backend provided there plus a PPD for a generic PostScript
>> printer (best, use the distiller.ppd as was provided once for Acrobat 3
>> by Adobe -- it still floats around in various dl areas on the internet).
>> 
>> If you set up a printer using this backend, the PDF printer will be
>> shared to all print clients, Linux, Unix, Mac OS X and Windows. Samba's
>> Point and Print capabilities will even make possible to download the
>> "driver" to all Windows clients (Unix clients get the "driver" through
>> CUPS native capabilities).
>> 
>> It means you can send all formats supported by CUPS to this PDF printer:
>> ASCII, image files, PS, PDF... and CUPS will take care to convert 
>> everything
>> to PostScript and the PDF backend will generate the PDF...
> 
>> 
>> 
>> Cheers,
>> Kurt
>> 
> 



More information about the samba mailing list