How do I decrypt a password-protected PDF on OSX?

24

11

I have a PDF that requires a password to view. I know what the password is. I frequently open this PDF to print it, and find entering the password each time incredibly annoying. How can I remove the password from the PDF?

Since I need to print it, simply taking a screenshot isn't a good solution.

I tried printing the file to a PDF, but Preview disables the "Save as PDF..." option in the print dialog.

disabled option

Brant Bobby

Posted 2011-02-12T02:30:13.743

Reputation: 2 186

Answers

15

Nathaniel's answer inspired me decide to try File/Save As... in Preview, which let me save a copy of the PDF with no password.

Save As dialog

I'm surprised that it was that straightforward, but it worked.

Brant Bobby

Posted 2011-02-12T02:30:13.743

Reputation: 2 186

Preview has lost some useful features over the years. I remember that on 10.4 Acrobat Reader would honor all DRM in a PDF, while Preview would happily ignore everything. On 10.6, Apple "fixed" that, but it was still possible to use the Color Profile Tool (the one in Utilities, name be be slightly off) to do the same, as the PDF rendering engine was identical, but the DRM enforcement code was missing. – user121391 – 2016-09-22T16:18:06.240

1Doesn't work under 10.9, but then maybe it depends on the type of PDF. DavidThompson's solution worked, both Chrome and Firefox. – None – 2013-11-01T23:23:52.267

44

There's a command-line tool called qpdf that can remove the password encryption from your PDF files, even in cases where Preview won't let you save a copy of or export the PDF.

Installing with Homebrew

  1. Install Homebrew if you haven't already.
  2. Install qpdf on your system by typing the following in Terminal:

    brew install qpdf
    

Installing with MacPorts

  1. Install MacPorts if you haven't already.
  2. Install qpdf on your system by typing the following in Terminal:

    sudo port install qpdf
    

Usage

Once qpdf is installed, use it to decrypt the file by typing the following in Terminal:

qpdf --decrypt --password=xxxxx encrypted-filename.pdf decrypted-filename.pdf

You can then open decrypted-filename.pdf in Preview to verify that it worked!

Joe Hughes

Posted 2011-02-12T02:30:13.743

Reputation: 541

I have a PDF which also had an owner's password that I didn't know. Preview asked me for the owner's password when I attempt to Duplicate the PDF file, as suggested in in Brant Bobby's (currently accepted) answer.

Using qpdf I was able to create password-free copies of my PDF without knowing the owner's password. – mikem – 2017-05-31T14:37:31.463

9

For those looking for a loop hole to save password protected PDF's in OS X 10.8.3 ... I found Opening the PDF in Chrome then Printing it to PDF using the Chrome dialog did the trick.

DavidThompson

Posted 2011-02-12T02:30:13.743

Reputation: 91

2Ohhh nice you can use the "Chrome" method in FireFox as well.. – None – 2013-07-05T09:14:08.837

1

You would likely need Acrobat Pro to remove it, if you can open it, are you able to print it to PDF?

Nathaniel Bannister

Posted 2011-02-12T02:30:13.743

Reputation: 914

Unfortunately, no. Preview grays out the "Save as PDF..." option in the Print dialog. – Brant Bobby – 2011-02-12T02:56:31.717

1

I did not find that Bobby Brant's solution worked on either 10.7.4 (the only 10.7 version I had available) or 10.8.2.

What I did find worked (most likely a loophole) was that I could export the file to TIFF (which created a massive 250MB file) and then print the tiff to PDF (which created an only slightly less awful 8MB file) --- all this from a 400kB original. Obviously the end result of this is a bitmap for each page, not a "real" pdf.

Maynard Handley

Posted 2011-02-12T02:30:13.743

Reputation: 111

0

There are two types of protection and password, one for opening, and one for printing, editing and copying.

The first type of password is called Open Password or User Passwords. With this password, the whole file is encrypted. Without knowning the password, you cannot open it, not to mention printing, editing or copying. The file is totally useless to you. You can only crack it by brute force, which will takes you months to hundreds of years to get back the password. The length of time depends on the power of your computer and the complexity of the password. This article will NOT tell you how to unlock Open Password protected PDF files.

The second type of password is called Owner Password. If you want to turn off protection for printing, editing and copying, you will be asked for this password. Technically speaking, the protection for printing, editing and copying is just a number of bits of flags. You can turn off these flags without knowing the Owner Password. All software SHOULD (not MUST) ask for Owner Passwords if someone want to change the protection flags. This is why we can unlock PDF files for printing, editing and copying without asking for a password.

Obviously, you belong to the second case, so it would be quite easy to remove the password and print the secured PDF.

By the way, Adobe Acrobat does help you. But it is quite expensive. It takes you $449 for full version of Adobe Acrobat Pro and $299 for Adobe Acrobat Standard for lifetime.

asonbott

Posted 2011-02-12T02:30:13.743

Reputation: 1