I am trying to verify that the content generated from wkhtmltopdf is the same from run to run, however every time I run wkhtmltopdf, I get a different hash / checksum value on the same page. We are saying something real, like using an html page:
<html> <body> <p> This is some text</p> </body </html>
I get different md5 or sha256 hashes every time I run wkhtmltopdf using an amazing line:
./wkhtmltopdf example.html ~/Documents/a.pdf
And using python hash code:
def shasum(filename): sha = hashlib.sha256() with open(filename,'rb') as f: for chunk in iter(lambda: f.read(128*sha.block_size), b''): sha.update(chunk) return sha.hexdigest()
or the md5 version that just swap sha256 with md5
Why is wkhtmltopdf generating another file sufficient to create another checksum, and is there any way to do this? Any command line that can be passed to prevent this?
I tried --default-header, -no-pdf-compression and --disable-smart-shrinking
This is the osx MAC value, but I created these pdf files on other machines and downloaded them with the same result.
wkhtmltopdf version = 0.10.0 rc2
source share