public List<PdfDocument> extractPageRanges(List<PageRange> pageRanges){
  List<PdfDocument> splitDocuments=new ArrayList<>();
  for (  PageRange currentPageRange : pageRanges) {
    PdfDocument currentPdfDocument=createPdfDocument(currentPageRange);
    splitDocuments.add(currentPdfDocument);
    pdfDocument.copyPagesTo(currentPageRange.getAllPages(),currentPdfDocument);
  }
  return splitDocuments;
}

public List < PdfDocument > extractPageRanges ( List < PageRange > pageRanges ) { List < PdfDocument > splitDocuments = new ArrayList < > ( ) ; for ( PageRange currentPageRange : pageRanges ) { PdfDocument currentPdfDocument = createPdfDocument ( currentPageRange ) ; splitDocuments . add ( currentPdfDocument ) ; pdfDocument . copyPagesTo ( currentPageRange . getAllPages ( ) , currentPdfDocument ) ; } return splitDocuments ; }
extracts the specified page ranges from a document .
