Fixes needed to get pdf format working with JtR test vectors

These fixes are needed to get pdf format working with JtR test vectors. I misunderstood how hex2str worked earlier. Hopefully this patch fixes all the existing problems. Also, we now reject truncated hashes instead of crashing.

Please review and pull.

Test Vectors: https://github.com/magnumripper/JohnTheRipper/blob/unstable-jumbo/src/unused/pdfdump

Passwords used are: openwall, testpassword, password

Passwords are embedded in the file names themselves.