Free Support Forum -

Compare two PDF files, Null pointer Exception using Java


Even i am getting same Null pointer Exception while comparing 2 PDF files. My Environment details are as below.

OS : Windows 10 64 bit
JDK : jdk1.8.0_112
IDE : Eclipse neon (4.6.0)

This Topic is created by atirtahir3 using Email to Topic tool.


Can you please confirm if you can compare Word files without any issue? Also, specify API version that you are using.

i have same problem as above, output return null when compare 2 files pdf. i used groupdocs.comparison ver 18.6.3. Comparing with docx, xlsx files without any issue. Hope to help.

1 Like


We cannot reproduce this issue at our end using version 19.3. See this screenshot - comparison.JPG (202.2 KB) and output - output.pdf (101.4 KB).
Can you please add GroupDocs.Comparison for Java 19.3 JAR file as an external library - external jar.JPG (53.2 KB) and remove its dependency from pom.xml, then share your feedback with us.


Can you please confirm if you can compare attached files successfully?
testtarget.pdf (2.4 KB)
testsource.pdf (2.1 KB)
Make sure you have Calibri and Times New Roman fonts installed in your environment.

output.pdf (123.9 KB)

Sorry for the delayed response, i tested with file provided by you and its working fine attached is the output.pdf file. But i get same execption as below while trying with other pdf’s.

Exception in thread “main” java.lang.NullPointerException
at com.pdfcompare.GroupCompareMainClass.main(


I am using GroupDocs.Comparison for Java 19.3 JAR file as an external library, but still same issue.


It seems that you are evaluating the API in trial mode. Because the output has a evaluation mark and API has limitation in such a case.
But the good thing is you can request a temporary license that is actually a time-restricted full license here.
You have to follow the wizard and on step 5 you can request a temporary license. This document will further help you out - (152.9 KB).
Secondly, make sure, the font-family that your source and target documents have is installed in your environment.