docs: public static int getPdfPageCount(File inputPdfFile) {
          PDDocument document = null;
          try {
              document = PDDocument.load(inputPdfFile);
              return document.getNumberOfPages();
          } catch (IOException ioe) {
              logger.error("Error counting PDF pages => " + ioe);
              return - 1;
          } finally {
              if (document != null) {
                  try {
                      document.close();
                  } catch (Exception e) {
                  }
              }
          }
      }