[ 
https://issues.apache.org/jira/browse/PDFBOX-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14292245#comment-14292245
 ] 

ASF subversion and git services commented on PDFBOX-2595:
---------------------------------------------------------

Commit 1654874 from [~lehmi] in branch 'pdfbox/branches/1.8'
[ https://svn.apache.org/r1654874 ]

PDFBOX-2595: use the firstID as secondID if the ID is created for the first time

> Pdfbox always sets the second part of documentID to the same value
> ------------------------------------------------------------------
>
>                 Key: PDFBOX-2595
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2595
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.8.8, 2.0.0
>            Reporter: Asger Askov Blekinge
>            Assignee: Andreas Lehmkühler
>             Fix For: 2.0.0
>
>
> From COSWriter.java lines 1268 (trunk) 1500 (1.8)
> COSString firstID = missingID ? new COSString( md5.digest() ) : 
> (COSString)idArray.get(0);
> COSString secondID = new COSString( md5.digest() );
> Notice that digest is called in both lines
> The javadoc for md5.digest() goes 
> "Completes the hash computation by performing final operations such as 
> padding. The digest is reset after this call is made."
> So, if missingID == true then the secondID will always be the hash of the 
> empty string.
> Acrobat reader uses this value for it's search index, as hinted at here
> https://stackoverflow.com/a/20201670



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to