Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

CUPS-PDF - A free virtual PDF printer Pick of the Week
The macosxhints Rating:

[Score: 10 out of 10]
CUPS-PDF is a free little package that was mentioned back in March in this hint as part of a solution to batch converting Word documents to PDF. However, CUPS-PDF is actually an amazingly useful little add-on for nearly anyone who regularly prints to PDF. CUPS-PDF installs a "virtual" PDF printer, which you can then select and use just as you would a normal printer. When you print a job to the virtual PDF printer, the output shows up in a cups-pdf folder on your desktop.

Yes, you can do exactly the same thing by clicking the PDF button in the Print dialog, then selecting Save as PDF from the drop-down menu. But CUPS-PDF makes the process much faster and easier. With the built-in solution, you have to not only click a button and choose a menu item, you then have to pick a name and save location for the resulting file. CUPS-PDF print jobs are always named after the document that you printed (prefixed by a job number), and they're automatically saved to the cups-pdf folder on your desktop. So if you set the virtual PDF printer as your default, you can print to a PDF by just pressing Command-P then Return. This makes it a snap to convert a number of existing documents, or to easily save all your web receipts during an extensive online shopping trip.

Another way to use your virtual printer is to make a desktop printer out of it (in Printer Setup Utility). Store it in your dock for fast access, and then just drag and drop print jobs to it when you need something turned into a PDF. And yes, Adobe Acrobat Pro includes a virtual PDF writer ... but this solution is completely free, works very well, and integrates perfectly into the Print dialog. Well worth a look if you're a heavy user of PDF printing.
    •    
  • Currently 2.96 / 5
  You rated: 3 / 5 (24 votes cast)
 
[144,672 views]  

CUPS-PDF - A free virtual PDF printer | 37 comments | Create New Account
Click here to return to the 'CUPS-PDF - A free virtual PDF printer' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
CUPS-PDF - A free virtual PDF printer
Authored by: amaloney on Aug 28, '07 02:35:04PM
I have never got this to work.
I think the reason is found at
http://www.codepoetry.net/support/other_software/cups_pdf_package/cannot_install_cups_pdf_printer
where it says:
===========
This is for the stock version of CUPS that comes with Mac OS X. If you've installed a different version then you need to manually install the backend module at /usr/libexec/cups/backend/cups-pdf into the proper directory for your version of CUPS.
=============
I have installed CUPS 1.2.12 and am using OS X 10.4.10.

I do not know where to go with this instruction "to manually install…" to try to get it to work.

Al Maloney


[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: mizraith on Aug 29, '07 05:33:50PM

I have actually gotten it to work -- and the hint a while back was more specific than this repost. Anyway, in the end it seemed kinda pointless given OS X's native print to PDF capabilities. Adding additional Automator workflows helps the print-to-pdf functionality as well.

The only use I found for the CUPS-PDF was to *share* the ability to print to PDF to those less fortunate Windows users. While this worked for most general purpose documents, it seemed to fall down pretty hard on (you guessed it) various PowerPoint type files (images, specifically).



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: Helge33 on Aug 30, '07 04:35:47AM

I am not surprised. I never understood the purpose of amateur software like CUPS which apparently is only useful for exotic or outdated printer models?

I neither understand why on a Mac(!) the 1560. PDF Utility shall be a 10 point pick of the week?

I neither understand why this part of the osxhint webpage is barely readable with Safari as there are no line breaks...??



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: goetzibubu on Jan 21, '12 01:07:33AM

Some special applications need special tools...
E.g. the virtual machine of Parallels Desktop. I do not want to miss or I cannot miss some WIN programs. So I use the virtual machine of Parallels.
To avoid printing output on paper I tested some other PDF tools as FreePDF and DoPDF-7. But I was not able to change these printers to standard printers. I have to use a virtual PDF printer and set to standard on the Mac side. So I was happy to find a driver as CUPS-PDF.



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: dewab on Aug 28, '07 03:23:10PM

Another way this could be done would be to create a customer Automator Workflow and save it in /Library/PDF Services/

Use the "Save PDF to Web Receipts Folder" as a template. Can also add timestamping and other information.



[ Reply to This | # ]
Non-Interactive, Digitally signing PDFs
Authored by: pepi on Aug 29, '07 02:11:38AM
The difference with a dedicated PDF Printer is, that it can be used non-interactively from any script and without any GUI needed. This can be very handy if you want to automate workflows or processes that do not involve a user to click buttons.
I'd like to see a CUPS receipt that will allow me to automatically sign a PDF I print through it with a cryptographic signature. I haven't yet found any automated solution to do this on the Mac. Pepi

[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: kyngchaos on Aug 29, '07 08:39:53AM

Except that Save as PDF won't work in Adobe Reader 8 - Adobe blocked this. Why would I want to save a PDF to PDF?

Form PDFs don't allow saving, so the helpful note from Adobe when you open one says to print a copy after filling in the form if you want a record of what you filled in. But you can't save to PDF when printing from Reader 8, so the only way to get a digital copy of the filled-in form is to print thru a virtual printer.



[ Reply to This | # ]
but how small are the resultant files?
Authored by: chidimaar on Aug 28, '07 05:00:40PM

This sounds promising, as I have to convert a bunch of keynote presentations to pdfs for students to download after my lectures (kids these days - want everything handed to them!). Keynote's (Apple's) built in export to PDF / print to PDF options both lead to rather large files that are tough on dialup lines. So my question is - does this make the pdf files smaller than Apple's version? I guess I'll get around to testing this one of these days but if anyone knows the answer, I'd appreciate hearing about it.



[ Reply to This | # ]
but how small are the resultant files?
Authored by: ploesslkh on Aug 28, '07 05:47:20PM

I printed the macosxhints webpage. With save as "pdf" it's 352 kb, with the CUPS-PDF 2.8 MB



[ Reply to This | # ]
but how small are the resultant files?
Authored by: rainwadj on Sep 04, '07 09:39:30AM

Similar results here. On a 2-page document (with graphics) in Pages:

CUPS-PDF: 6 MB
Print-to-PDF: 184 KB



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: NovaScotian on Aug 28, '07 05:38:40PM
I use CUPS-PDF, and have this little script in my Scripts menu to move through my printers:
tell application "Printer Setup Utility"
  activate
  repeat
    set myPrinters to every printer
    set C to count myPrinters
    set DefaultPrinter to current printer
    repeat with k from 1 to C
      if item k of myPrinters is DefaultPrinter then
        set current printer to item ((k mod C) + 1) of myPrinters
        exit repeat
      end if
    end repeat
    if button returned of (display dialog (name of current printer) as text default button 1 buttons {"OK"} with title "Press Enter when Printer is Correct" giving up after 1.5) is "OK" then exit repeat
  end repeat
  quit
end tell
Edit: Placed code in fixed-width box.
Edited on Apr 23, '10 05:20:43AM by robg


[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: plowedu on Aug 28, '07 07:35:52PM

I found the resulting PDF files to be very large, much larger than save as "compress PDF" or even as PDF



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: amaloney on Jan 27, '08 08:26:03PM

plowedu

Have you got any more info about the large size of the pdf documents created by cups-pdf?

Al Maloney



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: reece146 on Aug 29, '07 08:16:10AM

How does this do the paging of the resultant PDF?

I use Paparazzi for printing PDFs just because it automatically makes the resultant PDF one large/long file. Very handy when printing web apges and you don't want embedded images or whatever split between pages.

If this did the same thing I could dump Paparazzi becuase it is kinda tedious to have to re-open the URL in the program and then save. <minor_quibble />



[ Reply to This | # ]
CUPS-PDF - Virtual PDF printer?
Authored by: msbarb on Aug 31, '07 06:58:48AM

I just joined and was reading this particular thread and will continue to explore to find other things. However, this is what I need to know (or learn is maybe a better word)...

Yesterday I just discovered that I could create a PDF using Illustrator. I tested it, send my 1st PDF file in an email to test it...all is A-OK. Now I get eager for more PDF knowledge...but I am an old feeble minded person who kind of needs 'ABC directions' to do things. I am also a financially broke old person, so going out and purchasing software that will DO what I want is out of the question right now.

My Goal is to create a multiple page PDF and preferably with clickable links...though active hyperlinks is on the bottom of my list right now. I see many talking about PDFs here, and tips/tricks to do...but frankly my mind is boggled. Can anyone help me out with an EZ to use/follow system?



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: DDDAMORE on Oct 04, '07 12:19:26PM

Does anyone know how to change the name of the cups-pdf Folder?



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: thejoecarroll on Dec 04, '07 03:05:11AM
The destination folder can be specified here by editing the file /private/etc/cups/cups-pdf.conf Look for the following:
### Key: Out
## CUPS-PDF output directory
## special qualifiers:
## ${HOME} will be expanded to the user's home directory
## ${USER} will be expanded to the user name
## in case it is an NFS export make sure it is exported without
## root_squash!
### Default: /var/spool/cups-pdf/${USER}

Out ${HOME}/cups-pdf/


[ Reply to This | # ]
Printing Protected Documents
Authored by: quickbrownfox on Jan 25, '09 11:51:27AM

I was able to use this hint to print a PDF copy of a document which was protected by Adobe's LiveCycle Rights Management. The trick is to select "Print as image" in the Advanced Print Setup dialog (accessible from the Advanced button in Reader's print dialog). This creates a huge file (63MB in my case), but it does work. The resulting PDF can be opened in Preview.app, which was not the case with my original document. Opening this document and printing it to a PDF from Preview (via the PDF menu in the print dialog) will create a much smaller file.

Of course, this method turns the document into a bitmap, so you don't get selectable, scalable text, but it does allow you to save a local copy of a protected document.



[ Reply to This | # ]
Getting it to work with Snow Leopard
Authored by: victory on Aug 30, '09 05:34:52AM
[Sorry, these are *not* detailed instructions -- they are just general hints for technically-inclined users. If the cmd-line isn't your thing or the description doesn't make sense, I'd suggest waiting to see if the pre-packaged installer will be updated for 10.6]

Overall Problem(s): The current (v2.4.6.1) CodePoetry package of CUPS-PDF driver doesn't work under Snow Leopard. After installing the package, the CUPS-PRINTER doesn't even show up in the Printer & Fax system prefs when you select 'Add Printer'.

Solution step#1: Per the latest CUPS-PDF README, the /usr/libexec/cups/backend/cups-pdf binary must now be chmod'ed 0700 and be chowned by root:wheel. Otherwise, the CUPS-PRINTER won't even show up. Do this and the CUPS-PRINTER should now appear and allow you to add it.

Solution step#2: The new 'application sandbox' feature in 10.6 won't allow the required pstopdf binary to write to a folder in a user's homedir. So the default 'Out ${HOME}/Desktop/cups-pdf/' entry in the /etc/cups/cups-pdf.conf file will cause the printjob to silently fail. (Watch System.log for evidence of this)

After wasting a few hours trying different methods to get the sandbox to create an exception for pstopdf, I gave up. Instead I just edited the cups-pdf.conf entry to point to somewhere the sandbox will allow (e.g. '/var/spool/cups-pdf/${USER}' ) then just symlinked it to a folder in my homedir.

At the moment I prefer this rather than potentially messing with the system-wide sandbox config, since this security mechanism isn't completely documented as of yet.


NOTE: While I applaud the CodePoetry author for creating the prepackaged OSX installer, if anyone reading this is going to actually dig this deep to get it to work under Snow Leopard, you might consider just building the original CUPS-PDF driver (it's only a single file) directly from the source. See http://www.cups-pdf.de . The current latest (v2.5.0) worked fine for me using the above techniques. Just don't forget that you need to manually install/edit the cups-pdf.conf file also.

[ Reply to This | # ]
Getting it to work with Snow Leopard
Authored by: DaveNJ on Sep 02, '09 09:08:59AM

Hmmm, can't get this working under SL - the CUPS printer is created, but when printing it just appears in the dock for a bounce or two but then is gone...

Can someone provide detailed steps?



[ Reply to This | # ]
Getting it to work with Snow Leopard
Authored by: bbell2000 on Sep 20, '09 01:13:13PM

Thanks for this. The codepoetry site leads one to believe that version 2.4.6.1 addresses this issue, but I did not find that to be the case.



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: ChipMck on Sep 14, '09 08:51:18AM

to get CUPS-PDF to work with Snow Leopard - 10.6.0 or .1
- referring to CUPS-PDF 2.5.0 package's README

Permission setting for the BackEnd
via Terminal
cd /usr/libexec/cups/backend/
sudo chmod 0700 cups-pdf

Output Folder
Snow Leopard objects to ${Home} and ${User}
Suggestion
1. Finder --> Go --> Go to Folder ….
"/etc/cups" and punch Go
2. Select cups-pdf.conf and drag to your Desktop
3. On your Desktop, select cups-pdf.conf
4. Ctrl-Click and Open with Textedit
a. Find "#Out "
b. On new line "Out /Users/Shared/Cups_PDF"
c. Delete any other line starting with "Out "
d. Find "#AnonDirName "
e. On new line "AnonDirName /Users/Shared/Cups_PDF/Anonymous"
f. Delete any other line starting with "AnonD"
g. Save
5. Drag cups-pdf.conf back to folder /etc/cups and Authenticate/Replace
6. via Terminal
cd /etc/cups
sudo chown root:_lp cups-pdf.conf
exit
7. On your Desktop, trash cups-pdf.conf
8. Finder --> Go --> Go to Folder ….
"/Users/Shared/Cups_PDF"
9. Ctrl-Click and Make Alias
10. Drag the Alias to your Desktop

Good Luck



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: bossa nova on Sep 15, '09 04:24:25AM
ChipMck,
I tried what you have and received the following error:
The printer software was installed incorrectly. Please reinstall the printer's software or contact the manufacturer for assistance.
Again here is what you listed in your instructions...
to get CUPS-PDF to work with Snow Leopard - 10.6.0 or .1 - referring to CUPS-PDF 2.5.0 package's README
Permission setting for the BackEnd
via Terminal
cd /usr/libexec/cups/backend/
sudo chmod 0700 cups-pdf
Output Folder
Snow Leopard objects to ${Home} and ${User}
Suggestion
1. Finder --> Go --> Go to Folder ….
"/etc/cups" and punch Go
2. Select cups-pdf.conf and drag to your Desktop
3. On your Desktop, select cups-pdf.conf
4. Ctrl-Click and Open with Textedit
a. Find "#Out " --This line actually reads "Out" no pound sign here
b. On new line "Out /Users/Shared/Cups_PDF"
c. Delete any other line starting with "Out "
d. Find "#AnonDirName "
e. On new line "AnonDirName /Users/Shared/Cups_PDF/Anonymous"
f. Delete any other line starting with "AnonD"
g. Save
5. Drag cups-pdf.conf back to folder /etc/cups and Authenticate/Replace
6. via Terminal
cd /etc/cups
sudo chown root:_lp cups-pdf.conf
exit
7. On your Desktop, trash cups-pdf.conf
8. Finder --> Go --> Go to Folder ….
"/Users/Shared/Cups_PDF"
9. Ctrl-Click and Make Alias
10. Drag the Alias to your Desktop

---
Thanks!

John

[ Reply to This | # ]

CUPS-PDF - A free virtual PDF printer
Authored by: ChipMck on Sep 16, '09 02:40:30PM

you are right that the distributed file has 'Out ', not '#Out'.

I would change that line to be prefixed with '#' - this shows the original setting.
Then add a new line specifying another folder - without any substitutions ${...}.



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: ChipMck on Sep 17, '09 06:02:16AM
the site http://www.codepoetry.net/ was updated today 2009.09.17
stating that CUPS-PDF package would be updated for Snow Leopard

[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: SFJeep on Oct 12, '09 12:27:04PM

I was able to get this working for 10.6 by using different directories.

Instead of

Out /Users/Shared/Cups_PDF

AnonDirName /Users/Shared/Cups_PDF/Anonymous
I used

Out /var/spool/cups-pdf

AnonDirName /var/spool/cups-pdf
You could also have a subdirectory of /var/spool/cups-pdf to match the printer name. Of course, ensure that permissions are set appropriately for whatever directory you specify here.

[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: JLG on Oct 26, '09 03:19:41PM

This is the way to go. Apparently Snow Leopard is VERY restrictive when it comes to where it allows this printer driver to write files.

Edit /etc/cups/cups-pdf.conf and put a "#" in front of any "Out" or "AnonDirName" entry (thus commenting them out). The default cups-pdf values (pointing to /var/spool/cups-pdf) will work best here.

Create the cups-pdf printer.

Print a test job to your new printer.

Run the following command:
sudo ln -s /var/spool/cups-pdf/username /Users/username/cups-pdf
(replacing "username" with your username)

Now, you should be able to see your PDF files in the "cups-pdf" folder in your home directory.



[ Reply to This | # ]
CUPS-PDF - A free virtual PDF printer
Authored by: jatilano on Feb 11, '10 10:12:14AM
CUPS-PDF v 2.5.0 is out and it works great in Snow Leopard. Download v 2.5 from http://freshmeat.net/projects/cupspdf/.
cd /Users/username/Downloads/cups-pdf-2.5.0/src
Compile cups-pdf in the /src directory of the downloaded folder using gcc -O9 -s -o cups-pdf cups-pdf.c
Copy the compiled code sudo cp cups-pdf /usr/libexec/cups/backend/cups-pdf The instructions state to install to /usr/lib/cups/backend which is wrong. You need to install to /usr/libexec/cups/backend
Ensure you sudo chmod 0700 /usr/libexec/cups/backend/cups-pdf
Per the instructions you will need to edit cups-pdf.conf. Edit the following lines in the .conf file:
  • GhostScript /usr/bin/pstopdf
  • GSCall %s %s -o %s %s
  • PDFVer
    Copy the edited cups-pdf.conf file to /etc/cups.
    All of your PDFs will be saved to /var/spool/cups-pdf/username As mentioned above, creating a symlink to /var/spool/cups-pdf/ to my desktop worked perfectly. sudo ln -s /var/spool/cups-pdf/username /Users/username/Desktop/CUPS-PDFs
    I also created a desktop PDF printer by option-dragging the printer to my desktop. Now I can just drag a stack of files onto the desktop printer and they are converted to PDFs and easily accessed in a folder on my desktop.

    [ Reply to This | # ]
  • CUPS-PDF - A free virtual PDF printer
    Authored by: JHPArizona on Apr 22, '10 05:30:02PM

    I could not compile the source code :(
    I am running Leopard with X Code version 3.1.4
    I get 169 errors and 58 warnings :(

    However, I did use the posting here to edit the /etc/cups/cups-pdf.conf to make it work!

    Thanks for the postings.

    Jim



    [ Reply to This | # ]
    CUPS-PDF - A free virtual PDF printer
    Authored by: Don.a.dio on Mar 03, '10 02:30:37AM

    These instructions did the trick, thank you so much! Creating the alias is really helpful as well.
    I finally got it to work!



    [ Reply to This | # ]
    CUPS-PDF - A free virtual PDF printer
    Authored by: Sven G on Mar 06, '10 03:55:10AM

    This worked perfectly, both in Snow Leopard and Leopard (PPC). BTW, you can also copy the provided CUPS-PDF PPD to its location, as described in the source Read Me: "In case you want to use the color PostScript driver that comes with CUPS-PDF go to the extra/ subdirectory and copy CUPS-PDF.ppd to your CUPS model directory (usually /usr/share/cups/model [ /Generic ] )." This will show up as "Generic CUPS-PDF Printer" when setting up the printer in System Preferences.



    [ Reply to This | # ]
    Getting it to work with Snow Leopard
    Authored by: fievebr on Feb 04, '10 11:51:49PM

    Hi, everybody

    I tried to use cups-pdf under snow leopard but, after have followed the instructions above, I cannot make it work. It does not show the printer in the list.

    What is the problem ?

    Thank you in advance for your help

    Best regards,

    Bruno



    [ Reply to This | # ]
    Getting it to work with Snow Leopard
    Authored by: goetzibubu on Jan 21, '12 01:00:29AM

    You have to reboot to see the new printer



    [ Reply to This | # ]
    CUPS-PDF - A free virtual PDF printer
    Authored by: imtrying on Mar 22, '10 12:31:00PM

    I am having trouble with this -
    and feel like I am missing something major - when I enter this line in terminal:

    gcc -09 -s -o cups-pdf cups-pdf.c


    I get the following output:

    -bash: gcc: command not found

    Do I have to have something else installed on my computer????



    [ Reply to This | # ]
    CUPS-PDF - A free virtual PDF printer
    Authored by: Sven G on Mar 23, '10 01:10:25AM

    You need to install Apple's Xcode developer tools; see, for example, here:

    http://www.macupdate.com/info.php/id/13621/apple-xcode



    [ Reply to This | # ]
    CUPS-PDF - A free virtual PDF printer
    Authored by: imtrying on Mar 23, '10 08:46:28AM

    Thank you thank you - I got it to work - one thing -
    This works beautifully for word .doc or .docx however I do have to click through a print window for an excel file. For a PPT file I have to not only click print in the print window but it renames it as untiltled - any ideas on how to automate the renaming of those files and simplifying the process to remove the need to hit enter in the print window.



    [ Reply to This | # ]
    CUPS-PDF - A free virtual PDF printer
    Authored by: Skwidspawn on Jul 15, '11 06:14:28PM

    I downloaded CUPS-PDF earlier today to try something very specific. I'd recently purchased a PDF document that I was planning to use on my iPad. Unfortunately the PDF was locked down and could only be read using Adobe Reader X. After installing CUPS-PDF (working perfectly on Snow Leopard now, at least from my limited experience) I tried to print the DRMed PDF. The file failed to show up in the designated folder.
    The solution was to open the print dialog in Reader, click the "advanced" button, check the "Print as image" box (all other options will gray out), hit "OK" to go back to the print dialog, then "OK" again to print. Worked like a charm. The resultant file will be enormous. My 46 page document came out at 1.06GB (yes, gigabytes, it was music pdf, so lots of non-text items). Opening and re-saving in Preview shrunk it down to a more manageable 52.4MB.



    [ Reply to This | # ]