CUPS-PDF configure output directory

I would like to change the output directory of CUPS-PDF.

According to the documentation it can be done by editing /etc/cups/cups-pdf.conf.

In the standard config I haven’t found a single print in the default directory. I can use ${HOME}, and it prints to my user directory inside of /home.

I would like to specify a directory where all my prints go, e.g. /data/prints/pdf.

My question, how can this be done? I had it working before on another distro; unfortunately I do not have notes on how I did it, nor can I find the solution on the internet.

Can someone please help with this annoying problem?

(Personal note, this should have been taken care of long ago by making it a part of the printer settings. I have experienced this problem with all distros I have been on… now I want it solved :thinking:)

1 Like

$HOME is your users home directory.
I am not sure I understand where you want the pdf prints to go, but printing to anywhere other than the default or into a subdirectory under $HOME will require some finessing with permissions and possibly selinux since anything under the system directories is not normally writable by a standard user.

Looking at the default /etc/cups/cups-pdf.conf on my system I see this,

#Out /var/spool/cups-pdf/${USER}
Out ${DESKTOP}

which tells me the default output for a cups-pdf print would be sent to my $DESKTOP directory but since $DESKTOP is not defined it goes to the bit bucket.
The multitudinous comments within /etc/cups/cups-pdf.conf actually are a very good tutorial on how to use that file and what the configs do.

2 Likes

Check the output:

lpstat -v
1 Like

The output of lpstat -v

$ lpstat -v
device for PDF-Printer: cups-pdf:/

I think that it is the proper output, nothing wrong with that.

1 Like

Printing outside /home is exactly what I would like to configure.

According to the comments within cups-pdf.conf, or what I got from it, is that it must be possible to put in a path that points to a location within another partition on another disk.

It doesn’t help much to point to a symlink within the home directory, that I already found out.

I have don multiple searches on the internet with several search terms. I think that a lot of people would like to know the answer. Unfortunately I haven’t found anything that could help me - this includes the comments in the config file.

Questions:

What would be involved permissionwise to fix what evidently cannot be done the way I thought it could be?
The point is, that the directory I want to print to is owned by me, so I don’t get why tweaking permissions is necessary.

What is a ‘bit bucket’? I am not familiar with that expression.

sudo sed -i -r -e "s:^(Out\s).*:\1/data/prints/pdf:" /etc/cups/cups-pdf.conf
sudo mkdir -p /data/prints/pdf
sudo chown -R $(id -u):$(id -g) /data/prints
sudo semanage fcontext -a -t print_spool_t "/data/prints(/.*)?"
sudo restorecon -R /data/prints

Have you heard of a circular file? Or any of the sometimes old fashioned terms for trash or garbage or disposal bin? A bit bucket is the same – a term for getting rid of digital trash. If something digital is directed to a place that is not defined it disappears – forever.

The post above by vgaetera gives you a very succinct and complete series of commands to do what you asked. You will have to reboot, or at least restart cups for the change to take affect.

1 Like

Actually there’s no need for that as the issue appears to be SELinux-related and should be resolved by setting up the proper file context.