extractPages
Extracts the pages in range (1-based, inclusive on both ends) from pdf into a new document, via PdfBox's PageExtractor.
Return
the extracted pages as a new PDF.
Parameters
pdf
the source PDF bytes.
range
1-based inclusive page range, e.g. 2..4 for pages 2, 3, 4.
Throws
when the range is empty or falls outside the document's 1..pageCount bounds.