File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
pdfbox/src/main/java/org/apache/pdfbox/pdfparser Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -417,23 +417,17 @@ private boolean bfSearchForTrailer(COSDictionary trailer) throws IOException
417417 {
418418 trailer .setItem (COSName .ROOT , rootObj );
419419 trailer .setItem (COSName .INFO , infoObj );
420- if (trailerDict .containsKey (COSName .ENCRYPT ))
420+ COSObject encObj = trailerDict .getCOSObject (COSName .ENCRYPT );
421+ // check if the dictionary can be dereferenced
422+ // TODO check if the dictionary is an encryption dictionary?
423+ if (encObj != null && encObj .getObject () instanceof COSDictionary )
421424 {
422- COSObject encObj = trailerDict .getCOSObject (COSName .ENCRYPT );
423- // check if the dictionary can be dereferenced
424- // TODO check if the dictionary is an encryption dictionary?
425- if (encObj != null && encObj .getObject () instanceof COSDictionary )
426- {
427- trailer .setItem (COSName .ENCRYPT , encObj );
428- }
425+ trailer .setItem (COSName .ENCRYPT , encObj );
429426 }
430- if (trailerDict .containsKey (COSName .ID ))
427+ COSBase idObj = trailerDict .getItem (COSName .ID );
428+ if (idObj instanceof COSArray )
431429 {
432- COSBase idObj = trailerDict .getItem (COSName .ID );
433- if (idObj instanceof COSArray )
434- {
435- trailer .setItem (COSName .ID , idObj );
436- }
430+ trailer .setItem (COSName .ID , idObj );
437431 }
438432 return true ;
439433 }
You can’t perform that action at this time.
0 commit comments