Q: I’m having a problem with adding a password to a pdf file. When I
create a PDFViewSecurityHandler with a key length of 40 and the RC4
encryption mode I am unable to open the file in Adobe Acrobat. It
just says the password is invalid. If I use a key length of 128 and
RC4 or AES then it works fine. Do you know why it is failing with 40
If you select StdSecurityHandler(40, 1) you need to set the algorithm
revision to '2' because Acrobat 3 didn't support the full permission
set that was available in later versions of PDF.
StdSecurityHandler new_handler = new StdSecurityHandler(40, 1);
StdSecurityHandler constructor accepting AlgorithmType.e_RC4_40
automatically calls ChangeRevisionNumber(2).
StdSecurityHandler new_handler = new