[NTG-pdftex] Creating identical PDF files with different pdfTeX runs

Martin Schröder martin at oneiros.de
Wed Mar 15 14:25:04 CET 2006

On 2006-03-15 14:07:16 +0100, Frank Küster wrote:
> we (i.e. a couple of Debian developers, taking up old ideas of each
> individual and the tests in
> http://tug.org/svn/texlive/trunk/Master/support/tests/) are trying to
> implement some automated testing of pdf and dvi creation by pdftex.
> Possible applications are regression tests for the binary, for
> distributions (changed font setup etc.), or for package authors ("does
> the new version still cooperate with hyperref?").

Good idea.

> For this, it would be great if it were possible to create identical pdf
> files in subsequent runs of pdfTeX.  With 

This will only get you so far. If you want to compare PDFs, you
should not test for identical files, but for identical output:
Render the PDF to a bitmap (e.g. with ghostscript) and compare
the generated bitmaps. Otherwise your test will fail whenever the
output of pdfTeX is changed in any way. Even then your tests will
fail when we improve the typesetting of pdfTeX. :-}

> \pdfinfo{/CreationDate (1980-09-09)}
> \year=1980 \month=9 \day=9 \time=10
> \pdfcompresslevel0
> I get pdf files that can be compared, but only after some grepping:
> 	egrep -a -v '/BaseFont|/FontName|/UniqueID|/ID|/CreationDate' $< > $@

A start would be setting the system date -- this would seed /ID
and /CreationDate. Note that /ID also includes the filename.

> Is it possible to achieve identical pdf files directly, by adding the
> proper commands, or would it be possible to add this feature?

Currently it's impossible (and that's a feature :). Adding the
feature can't be that hard, though.


More information about the ntg-pdftex mailing list