Closed rami-mlaiel closed 4 years ago
Are you using the newest version?
Duplicate of #69
yes I am and using the last version. this how it looks in a Unix environment getDifferences() returns PageArea null
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...
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
Ah. Good to know about that. Glad you could solve it.
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 usingwrite
.Steps to reproduce :
Create two PDF, same number of pages(two pages) but with different data
Programmatically compare them with new PdfComparator("onePage.pdf","twoPages.pdf").compare()
Get the list of differences with getDifferences()
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.