Free Support Forum - groupdocs.com

Compare Pdf From File Without Settings Null Pointer


#1

Hello

I just downloaded your demo Java Comparison project and set my trial lisence. I’m getting a null pointer in this line:

result.saveDocument(Utilities.outputFileName(".pdf"));

Error is:

Exception in thread “main” java.lang.NullPointerException
at com.groupdocs.comparison.examples.PdfDocumentsComparision.ComparePdfFromFileWithoutSettings(PdfDocumentsComparision.java:23)
at com.groupdocs.comparison.examples.MainClass.main(MainClass.java:21)

Any ideas?


Null pointer Exception while comparing 2 PDF files
#2

@iahemmin,

Can you please share the problematic files (source and target) and sample code with us? Also share the API version that you integrated.


#3

Version 19.3
Used source and target PDF from the demo project. source.pdf (80.3 KB)
target.pdf (80.4 KB)
Thanks for your time


#4

@iahemmin,

Please share sample code as well.


#5

Main: https://pastebin.com/v3tm5qBg
PDFDocument: https://pastebin.com/D3ZrcCSj
Utilities: https://pastebin.com/cXSzpAFt

I really just took the supplied example end deleted the unneeded methods.


#6

@iahemmin,

We couldn’t reproduce this issue at our end. Please find the resultant file attached - output.zip (95.3 KB)
However, in order to further investigate this issue, we need following information:

  • Your complete console application/project
  • Operating system and its version
  • IDE that you are using

#7

Thank you for taking your time!
Groupdocs.zip (905.4 KB)
macOS Mojave 10.14.4 (18E226)
IntelliJ 2018.3.5
JDK 10

Any suggestions what I should try?

I’ve debugged the code and found that the result is null. All files are beeing found and are valid.


#8

@iahemmin,

Do you face this issue just in case of PDF comparison? Can you please check this with some other file format (Word)? Please share a screencast of this scenario as well.
We’d appreciate your cooperation in this regard.


#9

I’m getting this error while running a comparison ond a word document:

Caused by: class com.groupdocs.comparison.internal.c.a.s.exceptions.ArgumentException: Culture Name: en-CH is not a supported culture

I’m happy to upload a short video while running the code. You can expect it here in roughly three hours.

Thanks


#10

Just ran your docker image and am encountering the same problem.

Logs: docker.txt.zip (3.4 KB)


#11

@iahemmin,

Thanks for sharing the details. We’ll appreciate if you cover both scenarios in the screencast.


#12

Sorry for letting you wait had a lot of things to do.

You can find the video here: https://youtu.be/57nSLnoDPEU

Please tell me if you need any further information from my side I’m happy to help!


#13

@iahemmin,

Thanks for sharing the video.
This seems to be a environment based issue. We are further investigating it at our end. Your investigation ticket ID is COMPARISONJAVA-586.
As we have any futher update on this, we’ll surely notify you.


#14

Hi,

Even i am getting same Null pointer Exception as above 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)


#15

@ashwin1483,

Your query is addressed here.


#16

@iahemmin,

Can you please confirm if you get Null pointer exception using attached files?
testsource.pdf (2.1 KB)
testtarget.pdf (2.4 KB)


#18

The result which gets returned is still null.


#19

@iahemmin,

This could be because of missing fonts. Can you please confirm if Times New Roman is installed in your environment? If no, then install the font and do comparison again.


#20

Times New Roman is installed on my environment.


#21

@iahemmin,

We are further investigating this.