Bug 40557 - PDF encryption and Acrobat 5
Summary: PDF encryption and Acrobat 5
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.92
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 46730 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-20 18:52 UTC by Claude Chouinard
Modified: 2012-04-01 06:29 UTC (History)
2 users (show)



Attachments
An ugly fix. (31.35 KB, text/plain)
2008-05-13 22:35 UTC, Wei gong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Chouinard 2006-09-20 18:52:19 UTC
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.
Comment 1 Wei gong 2008-05-13 22:35:23 UTC
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.
Comment 2 Wei gong 2008-05-13 22:40:11 UTC
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.

Comment 3 Andreas L. Delmelle 2008-05-15 00:21:58 UTC
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.
Comment 4 Jeremias Maerki 2009-01-02 08:36:01 UTC
It appears this has been fixed by the following revision:
http://svn.apache.org/viewvc?view=rev&revision=708012
Comment 5 Conrad Kostecki 2009-02-18 05:52:51 UTC
*** Bug 46730 has been marked as a duplicate of this bug. ***
Comment 6 Glenn Adams 2012-04-01 06:29:12 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed