I'm trying to control the ID field in PDFs produced by ConTeXt.

When I run ConTeXt twice on the same input file, the resulting PDF files have different IDs, which can be checked e.g. by running grep -a "R/ID".

For pdf/xe/lua-LaTeX, this ID depends on the current time and the pathname of the PDF. The "current time" can be fixed using the environment variable SOURCE_DATE_EPOCH.

Since ConTeXt uses luatex as its engine (or optionally pdftex / xetex), I would have expected that the same method applies here, but it doesn't work.

How do I force ConTeXt to produce PDFs with identical ID if given identical input?

  • 1
    I deleted my answer because it failed by fatal error: kpse library is accessed (key: set_program_name) as Henri said. Was my previous test illusion? Commented Dec 7, 2019 at 15:16
  • I would have expected that context --nodates file works, but I still get a date in the pdf so I would suggest to ask on the context mailing list. Commented Dec 7, 2019 at 21:46
  • @UlrikeFischer Thanks! I don't really care about the date fields in the PDF, only the ID. Background: a PDF viewer I use stores settings incl. scroll position based on the ID.
    – A. Donda
    Commented Dec 7, 2019 at 23:57
  • But --nodates doesn't control the PDF ID either.
    – A. Donda
    Commented Dec 8, 2019 at 22:15
  • @A. Donda: If you need only fixed ID, see \pdfvariable trailerid near line 722 in doc/luatex/base/luatex-modifications.tex Commented Dec 9, 2019 at 6:16


You must log in to answer this question.

Browse other questions tagged .