PDF comparison in C#

I am interested in PDF comparison library; and made a few tests using your console example. I noticed two issues:



1. Input PDF files are very simple, single page, text-only files. However, comparison takes a long time; almost 7-8 seconds. Is this normal?



2. Comparison output DOCX file shows differences which actually does not exists. Can you advise on that?



Please find the attached two PDF files; which are the input files and the output DOCX file; which has incorrect differences marked.



Thanks.

Hello,

We are sorry to hear that you have this issue. Thank you for attached files. We checked them and also see that issues. Development team is aware about these issues. When we fix it, we will notify you at this thread.

Sorry for the inconvenience.

Sorry for late reply. GroupDocs.Comparison for .NET version 2.1 was released today, and it contains fixes including those which fix the problems with the files that you have provided. Please download it, try to reproduce and let us know is there still something wrong.

BTW, in this version you need to specify DOCX extension for the resulting document in any case, without relation to the input documents format.

@coskunalp

We’d recommend you to migrate to API version 20.X (20.7 more specifically). Document comparison is now more simplified. Have a look at the following code to compare two PDF files:

using (Comparer comparer = new Comparer("source.pdf"))
{
    comparer.Add("target.pdf");
    CompareOptions compareOptions = new CompareOptions()
    {
        DetectStyleChanges = true
    };
	comparer.Compare("result.pdf", compareOptions);
}

Do let us know if such an issue persists with version 20.7.

This issue is fixed in latest release. You can download or clone this sample console application.