install qpdf

brew install qpdf

check how many pages has the file

qpdf --show-npages your-filename-here.pdf

create new file based on page selection

qpdf input.pdf --pages . 1-14,16-23 -- output.pdf