How to remove password protection from a PDF desde Linux

PDF icon on red background

Sometimes when we will have met some PDF of the network that they share with us, and even PDFs that we have password protected ourselves, either to enable certain capabilities (copying text, printing, etc.), or simply that it cannot be opened to view the content without the password. If we have downloaded it from somewhere that shares these types of files, they have probably given us the password, and if we have protected it we will already know it. That is why we are going to teach you in a short step-by-step guide how to remove that protection to be able to use it more comfortably without entering the password every time we use it, and all from your favorite GNU / Linux distro.

It's not about cracking the password or forcefully unprotecting it! For that we will dedicate another article shortly ... The truth is that they exist various methods to remove password protection from a PDF file desde Linux, but here we are going to show you the 4 easiest to carry out. One of the easiest methods to do is to use one of the PDF viewers that we have in Linux that allow you to print the document in PDF format, such as Evince. The steps are:

  1. 1-We open the PDF with the program.
  2. 2-We go to the File menu (File).
  3. 3-Click on Print (Print).
  4. In the menu, we select all the pages, PDF output format and number of copies 1. You can put the place where it will be printed, name, etc.
  5. Click on the Print button.

The result will be an unprotected PDF. But if this doesn't work for you, don't worry, there are other methods such as poppler, which is an interesting library based on xpdf-3.0. In it there are a series of tools to work with PDF files from the terminal, and the truth is that it is quite interesting. You must first install the package on your distro, with your favorite package manager. For example, if you use pacman the package name is poppler, instead for RPM and DEB it will be poppler-utils. Once installed, you can run the following command:

pdftops -upw password nombre_pdf_protegido.pdf nombre_desprotegido.pdf

Obviously you should replace password with the password if you know it. If that method does not satisfy you, you can also make use of the pdftk package, which can manipulate PDF files. Once you install it on your distro with the package manager you use and using its name, you can start to remove password from PDF with:

pdftk nombre_pdf_protegido.pdf input_pw password output nombre_pdf_desprotegido.pdf

Again you must replace password with whatever password is ... And finally, the last method it would be using the qpdf package, a software to transform PDFs, how to encrypt and decrypt files. Being by default in most distros repositories, it will be easy for you to install it. Once installed, you can run the command:

qpdf --password='password' --decrypt nombre_pdf_protegido.pdf nombre_pdf_desprotegido.pdf

And now you can use the PDF without having to make the annoying gesture of entering the password every time you want to use it ...


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.