是否可以使用PHP从PDF文件中删除密码? [英] Is it possible to remove a Password from a PDF file using PHP?

查看:84
本文介绍了是否可以使用PHP从PDF文件中删除密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问问是否可以使用PHP从我已经知道密码的受密码保护的PDF文件中删除密码?我看过此页面,其中提供了许多选项但使用bash脚本. :(我被要求尽可能多地使用PHP.任何建议表示赞赏!

I would like to ask if it's possible to use PHP in removing a password from a password-protected PDF file in which I already know the password? I've seen this page which provides many options but using bash script. :( I was required to use PHP as much as possible. Any suggestions appreciated!

推荐答案

当然,您可能要做的就是对加密和压缩进行反向工程,并在PHP中实现反向操作-但为什么要麻烦:

Of course it's possible, all you need to do is reverse engineer the encryption and compression and implement the reverse operations in PHP - but why bother:

<?php
   `gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf`;
?>

C.

这篇关于是否可以使用PHP从PDF文件中删除密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆