What do you want to compare? iText could be used to compare structure and syntax, but... two different PDFs that look identical to the human eye, may have a completely different structure and syntax internally.
At iText, we have written JUnit tests that use GhostScript to create images of each page. These images are compared to each other on a pixel per pixel basis.
We also use iText in JUnit tests, but these tests look at the structure and the syntax more than at the content.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…