Q:

How do I produce bytewise consistent documents with pdflatex?

When I run pdflatex on the same .tex file twice, it produces similar results to my eyes but the contents of the file are slightly different (as revealed with an md5 checksum).  Is there any flag I can pass to pdflatex that will keep the output consistent?
What environment sensitive metadata might be in my pdf?  How can I control it?
Update: Doing a diff -a, I find the following:
> /CreationDate (D:20100413035938Z)
< /ModDate (D:20100413035938Z)
---
> /CreationDate (D:20100413041320Z)
> /ModDate (D:20100413041320Z)
106c106
< /ID [<41D2805AE64117914EDF6E09554EABAE> <41D2805AE64117914EDF6E09554EABAE>] >>
---
> /ID [<071832DAA2E77E13D96460479D9C6664> <071832DAA2E77E13D96460479D9C6664>] >>

A:

You can change the contents of the PDF's Info dictionary using Pdftex's \pdfinfo primitive:

\def\fixedpdfdate{D:20100413000000+00’00’}
\pdfinfo{
    /CreationDate (\fixedpdfdate)
     /ModDate (\fixedpdfdate) }

Put this right at the beginning of the document: there's some risk that the dictionary gets written out in several chunks. 
Postscript
Thanks to a duplicate of the question being asked at tex.stackexchange.com, I learnt that the /ID value passed at the end of the PDF to startxref still changes from invocation to invocation of Pdftex.  You can clobber the contents of /ID, apparently without ill effects: edit the text of the PDF between the /ID identifier to startxref from something like:
/ID [<B74AEC0FBDE0F25D7D2F5099291FEC6F> <B74AEC0FBDE0F25D7D2F5099291FEC6F>] >>
startxref
to: /ID [<0> <0>] >> startxref
I doubt that it is possible to ensure that /ID is unchanging from within Pdftex, but maybe it can be done in Luatex.

