我可以使用 ImageMagick 从 PDF 中删除密码吗?

bad*_*adp 5 pdf imagemagick

如果我有一个 PDF 并且我有它的密码,我只需将它发送到 PDF 打印机即可获得具有相同内容且无需密码的新 PDF。不过,这个过程并非完全没有痛苦(例如,Ubuntu 的内置 PDF 打印机似乎对尊重我的页面方向设置不太感兴趣;Windows 版 PDFCreator 只是看着我很有趣并打印了一条错误消息等)

我想让这个过程不那么痛苦,我想 ImageMagick 可以帮到我。然而...

convert foo.pdf -authenticate baz bar.pdf
Run Code Online (Sandbox Code Playgroud)

……不给我快乐。

   **** This file requires a password for access.
   **** The file was produced by: 
   **** >>>> ?Sh??,bd?  a?????
                                ?u?|!
                                      ???? <<<<
Error: /invalidfileaccess in pdf_process_Encrypt
Run Code Online (Sandbox Code Playgroud)

现在...我想如果有的话,也有pdf_process_Encrypt可能支持pdf_process_Decrypt手术,对吗?

那我该怎么做呢?

use*_*686 4

pdftk可能有帮助:

pdftk secured.pdf input_pw foopass output unsecured.pdf
Run Code Online (Sandbox Code Playgroud)

在 Windows 上,A-PDF Restrictions Remover也不错,尽管是付费软件。