<p>I need to compare large count of PDF files for it optical content. Because the PDF files was created on different platforms and with different versions of the software there are structural differences. For example:</p>

<ul>
<li>the chunking of text can be different</li>
<li>the write order can be different</li>
<li>the position can be differ some pixels</li>
</ul>

<p>It should compare the content like a human people and not the internal structure. I want test for regressions between different versions of the PDF generator that we used. </p>

I think your best approach would be to convert the PDF to images at a decent resolution and than do an image compare.
To generate images from PDF you can use Adobe PDF Library or the solution suggested at
Best way to convert pdf files to tiff files
.
To compare the generated TIFF files I found GNU
tiffcmp
(for windows part of
GnuWin32 tiff
) and
tiffinfo
did a good job. Use tiffcmp -l and count the number of lines of output to find any differences. If you are happy to have a small amount of content change (e.g. anti-aliasing differences) then use tiffinfo to count the total number of pixels and you can then generate a percentage difference value.
By the way for anyone doing simple PDF comparison where the structure hasn't changed it is possible to use command line diff and ignore certain patterns, e.g. with GNU diff 2.7:
```
diff --brief -I xap: -I xapMM: -I /CreationDate -I /BaseFont -I /ID --binary --text
```
This still has the problem that it doesn't always catch changes in generated font names.