docs: private int determineValidPageNumberFrom(int userPage) {
          if (userPage <= 0) {
              return 0;
          }
          if (originalUserPages != null) {
              if (userPage >= originalUserPages.length) {
                  return originalUserPages.length - 1;
              }
          } else {
              if (userPage >= documentPageCount) {
                  return documentPageCount - 1;
              }
          }
          return userPage;
      }