/ID in PDF

Started by toon, March 04, 2021, 08:33:50 AM

Previous topic - Next topic

toon

Hi all,

I am working on an application that hashes PDF (for their checksum) and comparing them. I noticed that even though 2 PDF are tagged with the same XMP metadata, their hashes are different.

I have narrowed down the root cause to be due to the /ID in PDF trailer section, such as below.

----------------------------------------------------------------------------------------------------------------
<<
/ID [ <c8bf0ac531b0fc7b5b9ec5daf0296834> <f6cea85f6b072cd486c2b542be2a7e8e> ]
/Info 6 0 R
/Root 5 0 R
/Size 9
/Prev 3069
>>
----------------------------------------------------------------------------------------------------------------

May I know is there any way to strip this information away or how is this ID calculated?



Phil Harvey

I don't know who/what uses this ID, but I think it must exist, and it must be unique.  ExifTool doesn't give you control over this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

toon

Thank you for the reply Phil!

In this case, is this /ID generated by ExifTool when we update the metadata of the pdf?
if so, how is this /ID calculated?

Phil Harvey

ExifTool takes the existing ID and adds 1 to the first byte.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).