docs: public static void splitPdf(File inputPdfFile, File outputPdfFile, int firstPage, int lastPage) {
          PDDocument document = null;
          try {
              document = PDDocument.load(inputPdfFile);
              Splitter splitter = new Splitter();
  
              splitter.setStartPage(firstPage);
              splitter.setEndPage(lastPage);
              splitter.setSplitAtPage(lastPage - firstPage + 1);
  
              List<PDDocument> documents = splitter.split(document);
  
              if (documents.size() == 1) {
                  PDDocument outputPdf = documents.get(0);
                  outputPdf.save(outputPdfFile);
                  outputPdf.close();
              } else {
                  logger.error("Splitter returned " + documents.size() + " documents rather than expected of 1");
              }
          } catch (IOException ioe) {
              logger.error("Exception splitting PDF => " + ioe);
          } finally {
              if (document != null) {
                  try {
                      document.close();
                  } catch (Exception e) {
                  }
              }
          }
      }