How to quickly modify cups-pdf printer output folder setting?

Longtime user of cups-pdf printer, I've always kept the default output folder setting: $HOME/PDF (or the identical /home/$USER/PDF).

Now I want to use a custom location for generated PDFs, but there is no output at all after modifying the config file (/etc/cups/cups-pdf.conf). Help?


The problem is with apparmor, not with cups or the virtual printer driver.

For any who want the convenience of 'one-touch' printing to pdf, the package can be installed by its older name:

sudo apt install cups-pdf

Or by the newer:

sudo apt install printer-driver-cups-pdf

Then to change the default output file destination, the config file may be edited:

sudo gedit /etc/cups/cups-pdf.conf (Use gksu or gksudo in place of sudo if preferred.)

On the line:

Out ${HOME}/PDF

Change the folder location as desired. Examples:

  Out ${HOME}/Desktop
  Out ${HOME}/print/pdfs
  Out /home/username/pdf

(If pasting an example line, use only one, like the original file.) Highlight the location part after the $, copy, then save the file and close it. Next, open the apparmor config file:

sudo gedit /etc/apparmor.d/usr.sbin.cupsd

Find the two lines near the bottom with the old default path, {HOME}/PDF

@{HOME}/PDF/ rw,
@{HOME}/PDF/* rw,

On each line, highlight everything between the @ and the trailing / and paste the new dirspec just copied. Inspect to be sure only the two paths were changed, and there are no missing or extra characters or spaces inserted. (Make a backup copy beforehand if unsure, and remember ctrlz undo is your friend.) Ex.

@{HOME}/Desktop/ rw,
@{HOME}/Desktop/* rw,

Save, close and reboot, then test print. Should work.