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

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri Jun 26 16:10:41 CEST 2015


On 26.06.2015 11:48, Markus Kuhn wrote:
>> On 6/26/2015 3:40 AM, Heiko Oberdiek wrote:
>>    \pdfinfo{/CreationDate null}
>>    \pdfinfo{/ModDate null}
> That still leads to
> /CreationDate null/ModDate null
> in the resulting PDF which is deterministic, but not what the ISO 32000
> standard recommends, as the entries are still present.

According to the PDF specification (PDF32000_2008.pdf), Table 317
"Entries in the document information dictionary", both values are
*optional* (except for ModDate, if PieceInfo is present).

The semantic of a null object as value for a key means, that
the entry is *not* present. Section 7.3.9 "Null Object":

| Specifying the null object as the value of a dictionary entry
| shall be equivalent to omitting the entry entirely.

Therefore this is valid PDF.

If you are unhappy with null values, then you can also specify
a deterministic date and time (whatever "deterministic" means
for a workflow). The format of the date string is described
in the PDF specification. Example:

% Set the deterministic values
% ----------------------------
\time=\numexpr 16*60\relax

% Format date string
% ----------------------------------------
% Format: (D:YYYYMMDDHHmmSSOHH'mm)
% Only the prefix "D:" and the year "YYYY"
% are mandatory, see PDF specification 7.9.4 "Dates"
\divide\timehour by 60
\multiply\timemin by 60
\advance\timemin by \time
  \the\year % four digits
  \ifnum\month<10 0\fi\the\month
  \ifnum\day<10 0\fi\the\day
  \ifnum\timehour<10 0\fi\the\timehour
  \ifnum\timemin<10 0\fi\the\timemin
% If time zone is needed, then \pdfcreationdate
% can be scanned, it contains the time zone as
% it is available for pdfTeX.

% Set date entries
% ----------------

% Result: /CreationDate(D:20150626160000)/ModDate(D:20150626160000)

Yours sincerely
  Heiko Oberdiek

More information about the ntg-pdftex mailing list