Sparticuz / node-qpdf2

A Content Preserving transformations on PDFs wrapped around QPDF
MIT License
20 stars 16 forks source link

Make password optional in decrypt #7

Closed arthurRbr closed 3 years ago

arthurRbr commented 3 years ago

Hi,

Could you make the password an optional input in decrypt.js ? Qpdf actually allows to decrypt a pdf without providing a password, or with a blank string as a password

qpdf --decrypt input.pdf output.pdf

Thanks

Sparticuz commented 3 years ago

Hey there, I have no idea why github didn't notify me of issues in this repo. I've started looking at this issue. Sorry for the delay.

Sparticuz commented 3 years ago

It looks like you need to enter "" as the value for password. See: https://stackoverflow.com/questions/42785645/qpdf-fails-to-encrypt-without-passwords

Regardless, I've added a test for blank passwords to catch this in the future. (And for documentation)

Thanks for the issue and sorry I didn't see this sooner!