Checking that 2 pdf are identical (md5 a solution?)

rlevesque raynald.levesque at gmail.com
Sat Jul 24 10:59:40 EDT 2010


Hi

I am working on a program that generates various pdf files in the /
results folder.

"scenario1.pdf"  results from scenario1
"scenario2.pdf" results from scenario2
etc

Once I am happy with scenario1.pdf and scenario2.pdf files, I would
like to save them in the /check folder.

Now after having developed/modified the program to produce
scenario3.pdf, I would like to be able to re-generate
files
/results/scenario1.pdf
/results/scenario2.pdf

and compare them with
/check/scenario1.pdf
/check/scenario2.pdf

I tried using the md5 module to compare these files but md5 reports
differences even though the code has *not* changed at all.

Is there a way to compare 2 pdf files generated at different time but
identical in every other respect and validate by program that the
files are identical (for all practical purposes)?



More information about the Python-list mailing list