How to get the total number pages of each PDF

To get the total number of pages of the two PDF files, start the comparison and assign the result to a local variable.

ResultModel result = new PDFComparer().compare( <file1>, <file2> );

The information about the page numbers is stored in an instance of the InfoData class, which is referenced by the ResultModel.

InfoData infoData = result.getComparisonParameters();
int firstTotalPageNumber = infoData.getFirstTotalPageNumber();
int secondTotalPageNumber = infoData.getSecondTotalPageNumber();
int differencePageNumber = firstTotalPageNumber - secondTotalPageNumber;

View full sourcecode