Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code to compare 2 PDF files

 
Uday Kumar Shanth
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i get the Java Code which compare the differences between 2 PDF files and highlight or store the diffrence in separate file.

Any Help is really appriciated!

Thanks,
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Define "difference" - ar you just talking about the text it contains, or also other things like layout etc.? If it's just about the text then you can extract the text from both PDFs using a library such as PDFBox and maybe generate diff output.
 
Uday Kumar Shanth
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have to Compare the entire content (Image, space, text, numbers..etc) of the 2 PDF files, i have PDFBOX Library, but not sure how to code to compare 2 PDF files


Thanks,
Uday Kumar
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uday, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/forum-lobby/67413-java-code-compare-2-pdf-files.html
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's going to be tricky. Can you give an example of two simple PDFs, and what their "difference" would be according to your definition? Especially two that contain differing images.

There will definitely be no code you can just copy from somewhere - lots of experimentation and programming on your part will be required. You should expect this to be a lengthy process.
 
Uday Kumar Shanth
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Example: 1. The text present in PDF1 is not matching/present in PDF2.
2. The position/line of the text present in PDF1 is not Matching with PDF2
3. The image/Image position present in PDF1 is not matching with PDF2
4. The result should generated to new doc/PDF/text

Thanks,
Uday Kumar
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uday Kumar Shanth wrote:Hi,

Example: 1. The text present in PDF1 is not matching/present in PDF2.
2. The position/line of the text present in PDF1 is not Matching with PDF2
3. The image/Image position present in PDF1 is not matching with PDF2
4. The result should generated to new doc/PDF/text

Thanks,
Uday Kumar

You need to read NotACodeMill in particular and probably other entries from HowToAskQuestionsOnJavaRanch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic