到目前为止,我用HummusRecipe.This在节点上生成了一个受密码保护的文件,用HummusRecipe.Following很容易就做到了,这个代码是用来加密密码保护任何pdf文件的。
const localFilePath = files.clientDoc.path;
const outputFilePath = `${process.cwd()}/logs/temp.pdf`;
const pdfDoc = new HummusRecipe(localFilePath, outputFilePath);
pdfDoc
.encrypt({
userPassword: '123',
ownerPassword: '123',
userProtectionFlag: 4
}).endPDF();
现在我想在express.But的另一个api中解密受密码保护的pdf,因为我已经研究过在HummusRecipe中没有任何解密方法可以解除服务器端的密码保护。
另一个选项是qpdf,但它在Express中不起作用,并给出'SPAWN‘错误。
发布于 2019-04-29 17:25:40
您可以在angular中使用PDF.JS。
https://stackoverflow.com/questions/55900346
复制相似问题