473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Compare PDF documents using C#

Hi,

Is there a way to compare PDF, Word Document, Excel using C# like WinDiff
utility that compares text file and display the result with the modified text
in both the document?

--
Thanks,
PS
Jun 27 '08 #1
2 5664
You can do it, but you will have to program different formats in unless you
are just comparing bits. A line in code can easily be compared by walking
the document and comparing lines. But this is code in each of the apps you
are talking about.

Let's take word for an example: To compare, you will have to read lines as
Word lines, not as lines in the file created by Word. Now, if you are using
Word 2007, you can actually compare XML, as that is the storage mechanism
(also true for Excel 2007). Assuming you are talking older versions of Word,
you then have to stoke up the Word libraries to read through the lines.

PDF presents the same problem, as what you see in the final document (viewed
in Reader, for example) is not what you will see if you open this in
notepad.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"PS" <PS@discussions.microsoft.comwrote in message
news:0C**********************************@microsof t.com...
Hi,

Is there a way to compare PDF, Word Document, Excel using C# like WinDiff
utility that compares text file and display the result with the modified
text
in both the document?

--
Thanks,
PS
Jun 27 '08 #2
Understood your point, do you have any example for the same?

Are there any legal issue if we use the PDF, Word, Excel library in .Net
application?

--
Thanks,
PS
"Cowboy (Gregory A. Beamer)" wrote:
You can do it, but you will have to program different formats in unless you
are just comparing bits. A line in code can easily be compared by walking
the document and comparing lines. But this is code in each of the apps you
are talking about.

Let's take word for an example: To compare, you will have to read lines as
Word lines, not as lines in the file created by Word. Now, if you are using
Word 2007, you can actually compare XML, as that is the storage mechanism
(also true for Excel 2007). Assuming you are talking older versions of Word,
you then have to stoke up the Word libraries to read through the lines.

PDF presents the same problem, as what you see in the final document (viewed
in Reader, for example) is not what you will see if you open this in
notepad.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"PS" <PS@discussions.microsoft.comwrote in message
news:0C**********************************@microsof t.com...
Hi,

Is there a way to compare PDF, Word Document, Excel using C# like WinDiff
utility that compares text file and display the result with the modified
text
in both the document?

--
Thanks,
PS
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nasos Makriyiannis | last post by:
Hi, I'm new to XSL and I was wondering if there is a string-compare function available. I am using the following IF statement but it does not seem to be working: <xsl:if...
1
by: Neil | last post by:
Folks, I've got a problem at work, and I'm hoping that someone out there may have had something similar (although I doubt it!) or may be able to offer some advice. I'm in the process of...
2
by: Muqu | last post by:
hi, I am trying to compare one nicely written html file against another program generated one, whose formatting isn't very appealing to human eyes. I am tuning the code so that two htmls will...
2
by: Ganesh Muthuvelu | last post by:
Hello, How can I compare or visually check the differences between two XML schemas. Let us say I have two files like "version_1.xsd" and "version_2.xsd" , how would I programtically find out the...
1
by: Twinkle | last post by:
HI All, I have a problem..How to match two same word files. if someword missing in second files then it should be highlight by color change.
2
by: =?Utf-8?B?SWtlciBMbGFub3M=?= | last post by:
I have to xml documents. I want to compare them and show them in two treeview controls. The one on the left is the new version of the document and the one is the right is the old version of the...
2
seshu
by: seshu | last post by:
Hi Everybody I have a piece of code to compare two documents using vb.net but the problem here is it is comparing the whloe sentence but not word by word how to compare word by...
3
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the...
1
by: =?Utf-8?B?RGFuaWVsIERpIFZpdGE=?= | last post by:
II want to compare how many seconds there are between files. If the files are within a 1 - 10 second range I want to copy them to their own folders. What I have so far is a couple methods that take...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.