3

The goal is to have version control correctly match revision of output pdf with revision of the source files. For example when I rebuild a document based on, say, the tip revision the resulting PDF appears as Modified. I assume that the only reason for this is the Date Created metadata? I know there are simple ways to control some metadata fields with options to the hyperref package but I don't see an option for date created. Is this field set by pdflatex itself? Is there any way to suppress it?

1
2

Under pdfTeX you can suppress the creation and modified date via \pdfinfoomitdate 1 (or another nonzero integer):

\documentclass{article}

\pdfinfoomitdate 1

\begin{document}

Lorem ipsum\ldots

\end{document}

See section 8.2 The document info and catalog of The pdfTeX user manual.

You can also specify a fixed (or non-existent) creation or modified date using the key-values /CreationDate (date) or /ModDate (date) within \pdfinfo:

/CreationDate and /ModDate are expressed in the form D:YYYYMMDDhhmmssTZ, where YYYY is the year, MM is the month, DD is the day, hh is the hour, mm is the minutes, ss is the seconds, and TZ is an optional string denoting the time zone. For example, this is the Unix epoch, the beginning of 1970-01-01 UTC, in this format: 19700101000000Z

Related: Is hyperref really the best way to add metadata to a TeX file?

3
  • I accepted the answer since it does exactly what I asked for - thank you. But as it turns out this does not solve my version control problem. I can't imagine what else could cause this. Perhaps this is a git or SVN question rather than tex question.
    – naor
    Aug 31 '16 at 22:26
  • 1
    @naor: So far I know there is a random influence on the font related parameters within (pdf?)TeX. If you compile the same document twice you don't get a 100% identical PDF. It seems that this changes with every minute, i.e. if you compile twice in the same minute then it is identical, but when the minute tick increases the PDF changes slightly. This happens even if the PDF creation time is set to a fixed value!
    – Martin Scharrer
    Apr 6 '18 at 7:56
  • Where does this randomness come from, and what purpose does it solve? Sep 16 '20 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.