Free Support Forum -

PDF comparison returns null in .NET

Hi Team,
Thanks for developing such a valuable product. I am using Compare product to compare 2 versions of PDF file. Below is the code i am referring to copied from sample project. When I execute the code I receive null as response of comparison.Compare() method.

        GroupDocs.Comparison.Comparer comparison = new GroupDocs.Comparison.Comparer();
        // Get instance of GroupDocs.Comparison.Comparer and call method Compare. 
        ICompareResult result = comparison.Compare(path+ "src1.pdf", path + "src2.pdf",new ComparisonSettings());
        // save result document to a file. 
        result.SaveDocument(path + "compare_out.pdf");

I am using free version for evaluation but if I can get this working quick stakeholders are ready to buy a commercial licence asap
I have attached screenshot of null response along with src1 and src2 pdf file. Let me know if you need any more details. Looking forward to hear from you.

src1.pdf (46.3 KB)
src2.pdf (43.2 KB)
GroupDocsCompareIssue.jpg (87.8 KB)


Thank you for using GroupDocs.Comparison for .NET API.

We have investigated the issue and it has been observed that this issue is raised only when you are running the API in trial mode. Hence we have logged this issue in our internal issue tracking system and will update you as soon as we get an update on this.
However, the good thing is; you can avail a 30 days temporary license which permits you to avail all the functionalities of the API. Please refer to this link for this purpose. Please load/apply the license and share your experience with us. We look forward to your response.

Attached is the sample output file for the PDF files provided by you when being compared by the GroupDocs.Comparison for .NET API in licensed mode. Let us know in case you find something ambiguous.
Compare-result.pdf (22.4 KB)

Hi Rida,
Thanks a lot for quick reply. I was trying to download a temporary licence for GroupDocs.Comparison for .NET API, but could not get the licence. also checked spam.
I went through the wizard and requested for temp licence using button as in screenshot attached. Also was redirected to successful temp licence request page. But I didn’t receive the licence. Please find the screenshots below.
It will be great help if you can please share a temp licence at my email as I am on a critical project where I need to implement PDF compare urgently.
Will be great if you can please help.
TempLicenseIssue.jpg (191.7 KB)


We sincerely apologize for the inconvenience but unfortunately, we cannot share a temporary license via email. Kindly wait for a few more hours and if you are still unable to get a license, please let us know.

Hi Rida,
Haven’t received temp licence email. Can you please help, will it be possible for you to drop in licence in dropbox/google drive etc any shared location from where I can download. Else please let me know how else can I grab a licence to complete my evaluation.


Please post a query about this issue on GroupDocs.Purchase forum. They will help you out in this regard.

@rida.fatima thanks for the help. Have posted the issue in purchase forum.

The pleasure is all mine. Do let us know in case you need any further assistance.

Hi @rida.fatima
I received the license file code works good now. Was just curious what settings/function from sample code you used to generate the compare-result.pdf file you shared in above message.
I am looking for result exactly in same format as in shared compared-result file.


Glad to hear that you were able to receive the license file. If you have already downloaded the sample project hosted on github, I am using the function “CompareDcumentsFromPathToOutputFile()” from the CommonComaprison.cs class of the Examples project to generate the compare-result.pdf file.
I am also pasting your required code here.

        // Get an instance of GroupDocs.Comparison.Comparer and call method Compare.
            GroupDocs.Comparison.Comparer comparison =  new GroupDocs.Comparison.Comparer();
            ICompareResult result = comparison.Compare(sourceFilePath,targetFilePath, new ComparisonSettings());

        // save result document to a file.

Please let us know in case you find something missing.

Hi @rida.fatima
Thanks for the help, did work well.
Have some query was not sure which forum to put my query on. I need to put annotations on PDF document after processing. GroupDocs.Annotation for .NET is perfect for me. While reading the docs I found each annotation type needs either Position object or Rectangle object to draw on PDF. How can I get these values. For example on PDF page 1 I need to put circle annotation over a word.How can i get the position/rectangle values for the word to pass on to annotation class.


Pleased to hear that.
We have a dedicated support forum for GroupDocs.Annonation Product Family where you can get all the support and answers to your questions related to the API. Please post this query on annotation forum. They will be able to guide you in this regard. Let us know in case you find something ambiguous.