简体   繁体   English

密码保护从页面生成的PDF

[英]Password protect a generated PDF from page

I'm currently using PHP for retrieving data and the JavaScript print function for my inventory reports and my staff saves it in pdf form. 我目前正在使用PHP来检索数据,并使用JavaScript打印功能来处理库存报告,而我的员工将其保存为pdf格式。 This is the sample output: 这是示例输出:

在此处输入图片说明

Everything works perfectly but I have a security issue. 一切正常,但我遇到了安全问题。 I want my staff to not be able to open the pdf, thus securing it with a password. 我希望我的员工无法打开pdf,因此无法使用密码保护它。

Is there, by any chance, a way to do this? 有没有机会做到这一点? Like whenever they click a button, instead of the print dialog box (ctrl+ P) opening, it will directly open a save to dialog box and it will automatically have a password so that I can be the only one who can view and print it. 就像他们每次单击按钮一样,它不会直接打开“保存到”对话框,而是会自动打开一个“保存到”对话框,而不是打开打印对话框(ctrl + P),因此我将是唯一可以查看和打印它的人。

Or is there a PDF library for this? 还是为此提供了PDF库?

Any help would be much appreciated. 任何帮助将非常感激。

Found a library and it works as expected. 找到了一个库,它可以按预期工作。

http://www.html2pdf.fr/en/download http://www.html2pdf.fr/en/download

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM