Featured image of post Decrypt PDF file

Decrypt PDF file

Using QPDF to remove the restrictions of your PDF files

In short, a PDF file can have 2 passwords:

  • User: to open a file
  • Owner: to restrict changing the permissions

If you download a file, which belongs to you, in many cases some restrictions should be applied on it and in many situations you may want to remove these but you may not have the owner’s password. That’s okay, here is an easy solution based on the qpdf tool.

Install QPDF

The documentation is available here : QPDF Documentation.
Below an easy way to install it:

  • For MacOs user, this tool can be installed via HomeBrew: brew install qpdf
  • For Debian-based systems, this tool can be install via apt: apt install qpdf

Remove the owner password and the encryption

This is the easiest step, you just have to run this command : qpdf --decrypt --password="user password" "source file.pdf" "destination file.pdf".

Note: the --password argument is optional. If the file does not require any password to open it, you can ommit this part.

Et voilà!

Licensed under CC BY-NC-SA 4.0
Last updated on Sep 15, 2022 00:00 UTC
Built with Hugo
Theme Stack designed by Jimmy