How-To: Remove a (known) password from a PDF file in Linux

I had a PDF the other day which required me to enter a password before viewing it, which is something I’d never seen before, so being a chancer I just slapped enter and it worked (i.e. there was no password, or more accurately the password was blank). However, keeping a file in that state is just stupid, so I wanted the “password” removed – and it turns out that it’s dead simple to do in Linux.

Two Stepper

  1. Install qpdf with synaptic or the command:
  2. Issue the following command:

    So, if your password protected pdf is called foo.pdf and the password is empty (i.e. “”) like in my case, you just issue something like this:

Job done!

How To: Fix CUPS PDF Printing in Linux

CUPS, the Common Unix Printing System, is b0rked in the standard Jaunty 9.04 release. Which is less than ideal when you want to print directly to PDF.

You can use “Print to File” and change from PostScript to PDF, and this will work, but I just wanted to use the PDF virtual printer, so did a bit of research and fixed it. Turns out cups is fine, but the AppArmour profile for cupsd was busted, so all we need to do is to tell AppArmour to just moan about cups-pdf instead of shutting it down due to the wonky profile.

From the console enter the following.

FiXX0r3d. Or smth.

Source (defunct as of 12/2013): http://linuxmoc.wordpress.com/2008/11/27/printing-to-pdf-broken-in-ubuntu-intrepid/

P.S. You can also fix the problem by disabling the AppArmour profile instead of putting the profile for cupsd to complain mode, full details given at source page above.