Removing pages from a PDF with pdftk

Specify the ranges you want to keep:

pdftk A=in.pdf cat A1-2 A5-10 16-21 23-end output out.pdf

Will remove pages: