[Samba] Printing with CUPS and PDF

Tom samba-lists at fleet.ucdavis.edu
Tue Apr 1 00:33:23 GMT 2003

This should be the last mesage in the thread, the be-all end-all 
mini-howto. :)

Using CUPS backend to create PDF virtual printer

1. Get a un*x box with CUPS and ghostscript set up on it.

2. Go here: http://printing.kde.org/downloads/ and download this backend 
script: http://printing.kde.org/downloads/pdfdistiller

3. Log in as root, put it in /usr/lib/cups/backend or wherever 
cups/backend lives.

4. 'chmod +x' the file (should be 755: rwxr-xr-x).

5. Restart CUPS ('service cups restart' or appropriate).

6. To check if CUPS recognizes it as a usable backend, let root run:
      'lpinfo -v | grep pdf'
    should output "direct pdf"

7. Test the pdfdistiller backend:
     a. '/usr/lib/cups/backend/pdf'
     	should output 'direct pdf "Unknown" "PDF Writing"'
     b. "/usr/lib/cups/backend/pdf 1 2 a b"
       should output: "Usage: pdf job-id user title copies options [file]"

8. Test existence of Ghostscript's ps2pdf with 'which ps2pdf'. Output 
should be a path like "/usr/bin/ps2pdf" or similar

9. Download a PPD file for cups to print with. An Adobe Distiller PPD is 
a great choice. I used the one from this page:
("Acrobat Distiller PPD for Windows")
     If this link is dead, search Google/web for "distiller ppd" and 
find a suitable file.

10. Put the PPD file in /usr/share/cups/model or wherever your CUPS 
model PPDs are stored.

11. Restart CUPS.

12. Add the printer to CUPS with the command:
     'lpadmin -p <Chosen Name> -E -v pdf:<out folder> -m <ppd-file>'
     'lpadmin -p PDFprinter -E -v pdf:/pub/pdf_out -m distiller.ppd'

13. Test the PDF output by manually printing to the new printer:
     'lpr -P PDFprinter test.txt'

Troubleshooting each step:

1. If you're stuck on #1, find a more appropriate howto.

2. If that file is missing, beg someone for a copy.

7. I got stuck on this one. without renaming it "pdf", it didn't work at 
all. No clue why. Try copying the file "pdfdistiller" the file to "pdf" 
in the same folder. ('cp pdfdistiller pdf'). If these aren't working, go 
no further. Make sure CUPS is installed properly and work on this first.

8. If this doesn't work, you'll need to install the latest "ESP 
Ghostscript". It's available at:
9. Adobe doesn't distribute this file, so it could be tricky to find.

10. Same as #3. PPD files made for Macintosh and Windows computers will 
need to be re-saved in un*x format.

11. There should be a number of PPD files in that folder already. Search 
for "laserjet.ppd" if you have no idea where to find them.

12. If this fails, make sure you're specifying a valid PPD file from the 
model folder in the "-m" part. Alternatively, you may use '-P <ppd>' 
instead of '-m', but you must specify the entire path.

13. No go? Time to start logging everything. After the first line of 
your backend file (pdf or pdfdistiller), add the line "set -x". Edit 
your cupsd.conf and set "LogLevel debug". Restart CUPS and peruse the 
information in /var/log/cups/error_log for good debugging info.


Thanks to Kurt Pfeifle [kpfeifle (at) danka (dot) de] for all the help, 
comments and editing this mini-howto with me.

More information about the samba mailing list