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:
- Grab https://github.com/qpdf/qpdf/releases
- Unzip/Install and navigate to the bin folder that holds qpdf.exe (or similar for your platform)
- Place the PDF you wish to work on in the same folder
- Run:
qpdf --decrypt InputFile.pdf OutputFile.pdf
(use"
s if the file name has spaces). - 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.
- Open the PDF
- 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.
- Open the resulting XPS file
- 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.
- 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)
Edit the resulting
.ps
file and remove:mark currentfile eexec 54dc5232e897cbaaa7584b7da7c23a6c59e7451851159cdbf40334cc2600 ... cleartomark
Save and distill the
.ps
file