How to get the total number pages of each PDF

Tags: #<Tag:0x00007f70c0d69218> #<Tag:0x00007f70c0d690b0>

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

© Copyright 1996 - 2018, i-net software; All Rights Reserved.