?
Solved

compare text in txt and pdf files

Posted on 2013-12-17
2
Medium Priority
?
276 Views
Last Modified: 2013-12-18
I have some text in a text file and a pdf file.  I want to compare the files to see if the text is identical.  What's the best way to do this?  In reality there will be lots of files like this, so the question is an attempt to automate a manual process (eg manually copying both files to textpad and comparing them).
0
Comment
Question by:AlHal2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
hjgode earned 1000 total points
ID: 39725790
This may work or not. As you know, sometimes texts in pdf are not continously. For Postscript (what is the bas of PDF) there is no really text, only letters. Especially, if you have a multi-column layout or pages with hanging indents or images, the 'text' may not be set continously in PDF.

But, if you are lucky, you can extract the text (possibly remove all spaces and paragraphs and line endings) and compare that to a text file (without any line endings and spaces).

I would use iTextSharp, here is an example on how to extract text from pdf: http://www.kunalpriyadarshi.com/2012/12/using-itextsharp-to-extract-text-from.html
0
 

Author Closing Comment

by:AlHal2
ID: 39726703
thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question