[NTG-pdftex] Deterministic PDFs (switch to disable addition of timestamps and random ID nonces)

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri Jun 26 03:40:19 CEST 2015


Hello,

Correction for the time settings in the information dictionary
--------------------------------------------------------------

On 25.06.2015 16:25, Hans Hagen wrote:
>     \pdfinfo{/CreationDate/null}
>     \pdfinfo{/ModDate/null}

A typo, "/null" is a name object with name "null".
Very likely the null object was intended. The null
object as value in a dictionary means that the key
is not present; pdfTeX scans for "/CreationDate"
and "/ModDate" and suppresses its own versions,
if they are found. (The full list is "/Creator",
"/Producer", "/CreationDate", "/ModDate", and "/Trapped".)

Correct version:

  \pdfinfo{/CreationDate null}
  \pdfinfo{/ModDate null}

Alternatively deterministic date values can be set there
in PDF date format, e.g.: \pdfinfo{/ModDate (D:20150626031503+02'00')}

>     \pdfinfo{/ID/null}

This line was likely intended to remove the "/ID"
entry. The /ID key is in the trailer dictionary.
But \pdftrailer{/ID null} will not work either,
because pdfTeX sets its own /ID values regardless, what
the user might have provided in \pdftrailer.

pdfTeX calculates the non-deterministic ID values in "utils.c", function
"printID". It uses the MD5 sum of the following
data for the ID values:
* the current time by calling function "time" (resolution is second),
* the current working directory by calling "getcwd" and
* the output file name.

The workaround is to overwrite the two hexadecimal string
of the two ID values with a deterministic hex string of the
same length. The ID key can be found at the end of the PDF
file and, the dictionary is uncompressed (trailer without
object compression of PDF 1.5 or the dictionary of type XRef
in case of object compression.

Yours sincerely
  Heiko Oberdiek


More information about the ntg-pdftex mailing list