Solved

compare text in txt and pdf files

Posted on 2013-12-17
2
260 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
2 Comments
 
LVL 16

Accepted Solution

by:
hjgode earned 250 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now