在最新发布的jspdf >= 2.2.0中,他们增加了加密机制,以密码保护pdf文件。但注意 jsPDF supports encryption of PDF just uses RC4 40-bit which is kown to be weak and is NOT state of the art. 使用的例子是:
var doc = new jsPDF({
encryption: {
userPassword: "user",
ownerPassword: "owner",
userPermissions: ["print", "modify", "copy", "annot-forms"]
}
});
2条答案
按热度按时间3mpgtkmj1#
目前没有办法用jspdf设置密码。使用node-qpdf软件包来保护您的PDF。
ih99xse12#
在最新发布的jspdf >= 2.2.0中,他们增加了加密机制,以密码保护pdf文件。但注意
jsPDF supports encryption of PDF just uses RC4 40-bit which is kown to be weak and is NOT state of the art.
使用的例子是: