Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:27:42+00:00 2026-06-11T06:27:42+00:00

I have two pdf files and I want to compare those two pdf files

  • 0

I have two pdf files and I want to compare those two pdf files and print the difference in messagebox.

So far I have this (but it is not working as I expect):

  private void button1_Click(object sender, EventArgs e)
    {
        string str1 = this.textBox1.Text;
        string str2 = this.textBox2.Text;

        string comparison = str1.Replace(str2,"");
        MessageBox.Show(comparison);
    }


 private void ParsePDF(string filePath)
    {
        string text = string.Empty;

        PdfReader reader = new iTextSharp.text.pdf.PdfReader(filePath);
        byte[] streamBytes = reader.GetPageContent(1);
        PRTokeniser tokenizer = new PRTokeniser(streamBytes);

        while (tokenizer.NextToken())
        {
            if (tokenizer.TokenType == PRTokeniser.TokType.STRING)
            {
                text += tokenizer.StringValue;
            }
        }
        this.textBox1.Text = text.ToString();
        this.textBox2.Text = text.ToString();
    }

}

and just below I call that method: ParsePDF(“C://Users//lf222aw//Desktop//file1.pdf”);

my program works like this:
Suppose i have one textbox with text “I love stackoverflow” and the other textbox
“I stackoverflow” and my program prints this as a result: “I love stackoverflow” and what i want to print is “love” as a difference between two those files

Any idea??
Regards,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:27:44+00:00Added an answer on June 11, 2026 at 6:27 am

    If you split your files into words, you may be able to use something like:

        Dim str1 = New String() {"I", "love", "stackoverflow"}
        Dim str2 = New String() {"I", "stackoverflow"}
        Dim Diff = str1.Where(Function(x) Not str2.Contains(x)).ToArray()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two files. I want to create pdf with these two files. does
I have the following code which will generate two pdf files containing plots to
I'm using iTextSharp to generate some PDF files. I have two tables which have
I'm writing a major report, and have two PDF files I'd like to include
I have two pdf files and two text files which are converted into ebcdif
I have two PNGs that I am trying to combine into a PDF using
Have two folders with approx. 150 java property files. In a shell script, how
I have two files client.php and server.php. The client file send a HTTP request
I have two update panels on a page. And I want to update both
Let's say I have two PDF templates created with Adobe Acrobat, which are both

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.