red6 / pdfcompare

A simple Java library to compare two PDF files
Apache License 2.0
220 stars 66 forks source link

Different page not listed in `getDifferences` using Unix environment #74

Closed rami-mlaiel closed 4 years ago

rami-mlaiel commented 4 years ago

When comparing to PDF with a different number of pages, the missing pages are not present when calling getDifferences but are present in the PDF file obtained by using write.

Steps to reproduce :

Current result : The list has two null elements

Expected result : The list has two PageArea elements representing the difference

the PageArea is not created which makes it null as a result.

finsterwalder commented 4 years ago

Are you using the newest version?

finsterwalder commented 4 years ago

Duplicate of #69

rami-mlaiel commented 4 years ago

yes I am and using the last version. this how it looks in a Unix environment getDifferences() returns PageArea null

finsterwalder commented 4 years ago

This looks really strange to me. I'm not sure I understand what you are doing. Your descriptions are somewhat inconsistent. You write about two two page document (even though one is called onePage.pdf). Then you show example output with three null pages and differences on page 2 and 3. Could you provide the two documents, that you compare? Or two other documents, that cause the problem? And maybe the project/code you execute that gives the output above? Which JDKs are you using on the different platforms? Do you have any changes in the application.conf or Environment? Executing the same code on Window or Unix should not make such a difference. I'm developing on Linux myself. I also double checked the code. For documents with the same amount of pages, I don't see how this could happen. And even for documents with differing amount of pages, this should work fine in version 1.1.50. You only ever get a PageArea, when there are actually differences on a page. And the collection you get when calling getDifferences() should never contain null values. So without further code examples or input I'm struggling to find any problems here...

rami-mlaiel commented 4 years ago

yes you were right, the problem was with the -Djava.io.tmpdir as the folder was not created so it couldn't get the differences found in the pages

finsterwalder commented 4 years ago

Ah. Good to know about that. Glad you could solve it.