2019-07-17

Remove PDF password (security) with qpdf


Đôi khi nhận file PDF nhưng bị đóng đấu "SECURED". Mình không thể clear password hay edit được mặc dù biết password. Cũng không thể print thành PDF khác được. Chưa kể trong Foxit không có enable mấy functions cần dùng.

Thực hiện như hướng dẫn ở đây


  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/ .