pi = new ObjectExtractor(document).extract();while (pi.hasNext()) {// iterate over the pages of the documentPage