Open rafikhamid opened 4 years ago
Would you mimd put a PR for this since you already have investigated, thanks! @rafikhamid
Hi @chunyenHuang I did not want to create a PR for this because my fix is to completely remove the method _getEncryptOptions(options); and I am not sure about the purpose of it, so removing it might break something. If you want me to remove it I can create a PR for it.
https://github.com/chunyenHuang/hummusRecipe/blob/54d334f00f8c0740952a8bb11034bde39d5cc42c/lib/encrypt.js#L91
I need to protect my PDF that has a watermark from being removed, while the PDF should not require a password when opened for read, I achieved that in HummusJS by setting ownerPassword with an empty userPassword like this :
Now with hummusRecipe, when I try the following code, the out.pdf is not protected in modification
because 'userPassword' is not being provided to hummus in 'encryption_' in encrypt.js line 106 :
and on documentation of HummusJS it is clearly mentionned that ownerPassword is only used when we pass userPassword:
A workaround is to pass the options as is to HummusJS and not use the _getEncryptOptions method
Can you please fix. Thanks