Remove The Password Of A Password Protected PDF Files

This brief tutorial describes how to remove the password protection from the PDF files. Please note that we are not going to hack or crack the password of PDF file. Instead, we just remove the known password of the PDF file using qpdf application from Terminal. It is really easy and fun. Let us get started.

What is Qpdf?

From the man pages,

The  qpdf program is used to convert one PDF file to another equivalent PDF file. It is capable of performing a variety of transformations such as linearization (also known as web optimization or fast web viewing), encryption, and decryption of PDF files. It also has many  options for inspecting or checking PDF files, some of which are useful primarily to PDF developers

Install Qpdf

Install Qpdf in Debian based system using command:

sudo apt-get install qpdf

In RPM based systems, we can install it using command:

sudo yum install qpdf

Remove Password Protection from PDF file

I have a password protected PDF file in my home folder, and I know the password. Be mindful that you should have your PDF file password. Otherwise, you can’t remove the password protection using this method.

My password protected PDF file name is password.pdf.

When opening the pdf file, It asks me to enter the password.

password.pdf — Password Required_001

Ofcourse, I know the password ,and I can easily open it using the password. But I really don’t want password protection.

Using the following command, I am going to remove the password from the password.pdf file, and save it with a name nopassword.pdf in the home directory.

qpdf --password='mypassword' --decrypt password.pdf nopassword.pdf

Done!

Then, I opened the PDF file, It didn’t ask to enter the password. Very easy, isn’t it?

For more details about Qpdf, I suggest you to read the Qpdf manual.

Remove password Using Pdftk

Also, you do it using pdftk.

To install Pdftk, use the following command on Debian based system.

sudo apt-get install pdftk

On RPM based systems:

Refer the pdftk installation page.

After installing it, run the following command to remove the password.

pdftk password.pdf input_pw mypassword output nopassword.pdf

Thanks Mr.David to let us know about Pdftk via Comment.

That’s it. happy weekend!