Thanks, Michael - that is exactly what I needed to know!  I will take this
issue up with Oracle.

I will also see if I can find some work-around to make the file acceptable
to iText.  Maybe I can edit the ID or re-save the file before trying to sign
it, forcing the generation of a new ID....?


mkl wrote:
> 
> msinatl,
> 
> 
> msinatl wrote:
>> Thanks for your response. Please pardon my ignorance, but what is the
>> document ID and how can I retrieve it?
> 
> If you look at the PDF document using a text or hex viewer or a dedicated
> PDF analysis tool, you'll find the trailer dictionary nearly at the end of
> it. In the case of your example document 
> http://old.nabble.com/file/p28472754/74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF
> 74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF :
> 
> trailer
> <</ID [ (22) (22)]/Size 4>>
> 
> The document ID is the entryin square brackets after the /ID name, i.e.
> (22) (22). This is wrong. The PDF spec ISO 32000-1:2008 states in 14.4:
> 
> 
> File identifiers shall be defined by the optional ID entry in a PDF file’s
> trailer dictionary (see 7.5.5, “File Trailer”). The ID entry is optional
> but should be used. The value of this entry shall be an array of two byte
> strings. The first byte string shall be a permanent identifier based on
> the contents of the file at the time it was originally created and shall
> not change when the file is incrementally updated. The second byte string
> shall be a changing identifier based on the file’s contents at the time it
> was last updated. When a file is first written, both identifiers shall be
> set to the same value. If both identifiers match when a file reference is
> resolved, it is very likely that the correct and unchanged file has been
> found. If only the first identifier matches, a different version of the
> correct file has been found.
> 
> To help ensure the uniqueness of file identifiers, they should be computed
> by means of a message digest algorithm such as MD5 (described in Internet
> RFC 1321, The MD5 Message-Digest Algorithm.
> 
> 
> At first glance, that ID of yours is wrong as it uses literal strings and
> not byte strings. It additionally is likely wrong as a two-character ID
> generally does not ensure uniqueness.
> 
> On the other hand iText is wrong in assuming a length of exactly 16 bytes
> in PdfEncryption.createInfoId() because the MD5 digest is merely an
> example for a way to generate something unique enough.
> 
> Regards,   Michael.
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28473350.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to