[pdftex] [bug] \pdfmdfivesum returning wrong value

Heiko Oberdiek oberdiek at uni-freiburg.de
Sun Jun 10 22:01:56 CEST 2007


On Sun, Jun 10, 2007 at 08:28:20PM +0200, Stephan Hennig wrote:

> the value returned by
> \pdfmdfivesum{plain.tex}
> \bye
> is
> 75A63AD4F2BDE3BCCE62E19E4A77AB15

It's correct. Create a file `plain.dat' with contents `plain.tex'
(9 bytes) and run md5sum:

  $ md5sum plain.dat
  75a63ad4f2bde3bcce62e19e4a77ab15  plain.dat

> which is significantly different from
> > $ gpg --print-md md5 `kpsewhich plain.tex`
> > texmf/tex/plain/base/plain.tex: 41 C2 6C 4F 5E FA 32 DF  39 78 59 08 0C 65 7E D9

This is different, here you are using the file contents of file plain.tex.

\message{[\pdfmdfivesum file {plain.tex}]}

This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
entering extended mode
(./test.tex [41C26C4F5EFA32DF397859080C657ED9] )
No pages of output.
Transcript written on test.log.

> Out of curiosity, what applications did you have in mind when
> introducing file handling primitives, such as \pdfmdfivesum or \pdffilesize?

* Package `embedfile', adds this data to embedded files,
  see PDF specification.

* Package `embedfile', adds this data to embedded files.
* Package `bmpsize' that analyzes binary image files.
* Package `grffile' uses it as existence check for
  image files. This avoids problems with spaces and other
  special characters.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>

More information about the pdftex mailing list