Documents created with an owner password and no edit/copy/annotations can't be openned with Acrobat Reader 5 and 4, Acrobat asks for a password to open the file, even if no user password is set. Everything works fine with fop 0.91. We tried to specify a user password, but we can't open the document with the user password nor the owner password. It works well with Acrobat Reader 6 and 7. But some of our customers who are receiving our PDF files are on Windows 98 and Acrobat Reader 4.0.5 seems to be the last version available for this OS.
Created attachment 21960 [details] An ugly fix. changed function outputTrailer(). Output only one “/ID” key in trailer dictionary whether the PDF is encrypted or not.
I happened to meet this problem too. (with FOP0.94 and Acrobat5.0.5jp) Encrypted PDF made by FOP have two “/ID” keys in trailer dictionary, it looks like: trailer << /Size 13 /Root 2 0 R /Info 4 0 R /ID [<DC6AA9DED0627627476219E8BB6F5592> <DC6AA9DED0627627476219E8BB6F5592>] /Encrypt 5 0 R /ID[<3A965D0CD346E846E46079C99CC8651D><169B38EC863D117DEEFDB50695766732>] >> It seems that Acrobat5 use the first (which should be the second in the example above) “/ID” to authenticate user password. Acrobat after 6.0 seems to read dictionary from below. According to PDF spec (v1.4), “No two entries in the same dictionary should have the same key. If a key does appear more than once, its value is undefined.” ([Page35]3.2.6 Dictionary Objects). It should have only one “/ID” key in trailer dictionary whether the PDF is encrypted or not. I have upload an temporary (ugly) fix for this.
Thanks for offering the fix. I'm not sure it is that 'ugly' as you think. Simply seems to correct a small oversight in FOP's PDF library.
It appears this has been fixed by the following revision: http://svn.apache.org/viewvc?view=rev&revision=708012
*** Bug 46730 has been marked as a duplicate of this bug. ***
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed