i need to write a java class that compares two pdf files and points out the differences(differences in text/position/font)
using some sort of highlighting.
my initial approach was use pdfbox to parse the file using pdfbox and store the extracted text using in some data structure that would help me with comparing.
Is there any java library that can extract the text,preserve the formatting,help me with indexing and comparing.Can i use tika/ google's diff-match for this.
tika extracts text in the form of xhtml but how can i compare two xhtml files?
解决方案
I had to compare tons of pdf files in my project. my requirement was to compare the pdf files by pixel by pixel. After a lot of googling and as i could not find anything good, I ended up creating my own pdf utility for this purpose.
Please check this blog for more details & jar download.