How to remove security from a PDF file?

Assuming it's simply a 'rights' (owner) password that restricts things like editing, printing, and copying (i.e. the password does not need to be entered to open the file) the following will remove the restrictions:

  1. Grab https://github.com/qpdf/qpdf/releases
  2. Unzip/Install and navigate to the bin folder that holds qpdf.exe (or similar for your platform)
  3. Place the PDF you wish to work on in the same folder
  4. Run: qpdf --decrypt InputFile.pdf OutputFile.pdf (use "s if the file name has spaces).
  5. Do what you like with the OutputFile.

If your PDF file is user password protected, change step 4 to qpdf --decrypt --password=yourpassword InputFile OutputFile

This won't work for Adobe Digital Editions and may have issues with digitally-signed files.

Some discussion on the background of these owner password restrictions at https://lwn.net/Articles/335415/ .


Contrary to the other solutions, you do not need additional software.

Anyone with Windows can do it with no extra software in 4 simple steps.

  1. Open the PDF
  2. Go to File > Print. From your print options choose Microsoft XPS Document Writer. Although you might expect it to print, it does not print anything, it will create an XPS Document.
  3. Open the resulting XPS file
  4. Press Print, go to Microsoft PDF Creator. It will now save it as a PDF again. Again, it will not print.

In my case I had to remove the first/last page of a document so I only printed the pages required.


  1. Print to a PostScript (PS) printer (where the printer's port is set to print to file, not to the printer -- or check the "Print to file" option in the Print dialog)
  2. Edit the resulting .ps file and remove:

    mark currentfile eexec
    54dc5232e897cbaaa7584b7da7c23a6c59e7451851159cdbf40334cc2600
    ...
    cleartomark
    
  3. Save and distill the .ps file

Tags:

Pdf

Security