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?
202k 55 55 gold badges 497 497 silver badges 754 754 bronze badges asked Aug 1, 2020 at 23:15 923 2 2 gold badges 9 9 silver badges 22 22 bronze badgesPlease don't create meaningless and useless tags like destination , that make no sense within the context of this site
Commented Aug 4, 2020 at 4:33The 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.)
Out $/PDF
Change the folder location as desired. Examples:
Out $/Desktop Out $/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, /PDF
@/PDF/ rw, @/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 ctrl z undo is your friend.) Ex.
@/Desktop/ rw, @/Desktop/* rw,
Save, close and reboot, then test print. Should work.
202k 55 55 gold badges 497 497 silver badges 754 754 bronze badges answered Aug 1, 2020 at 23:15 923 2 2 gold badges 9 9 silver badges 22 22 bronze badgesFor those of you who have symlinked folders this will be helpful. In addition to setting up the above custom folder in /etc/cups/cups-pdf.conf do the following. In the 'K'Ubuntu 20.04 and above (the below explanation is implemented in Kubuntu 21.04), the default folder settings in the apparmor ( /etc/apparmor.d/usr.sbin.cupsd ) shouldn't be fiddled with. The defaults are good as below, retain them as is.
@/[^.]*/ <,**/>rw, @/[^.]*/** rw,
In my case i have a separate ext4 partition /mnt/data/username for hosting the user directories such as Documents, Downloads, Music, Videos, Public, Templates, Pictures and VirtualBox VMs. I symlink these folders to /home/username/ example as below.
ln -s /mnt/data/username/Documents /home/username/Documents
So, for the cups-pdf print-to folder PDFs, i have mine in /mnt/data/username/Documents/PDFs .
My setup is as follows: in /etc/cups/cups-pdf.conf set
Out $/Documents/PDFs
in /etc/apparmor.d/usr.sbin.cupsd leave it at defaults. Run
sudo dpkg-configure apparmor
and in the dialog box that appears, add /mnt/data/ (note the trailing '/') as additional $
I need my userdirs in /mnt/data/username/ as i share the very same folders with ArchLinux Gnome40 install with the same username and UID/GID.
For reference and understanding why, see the following links: