Splitting pdf files

2024-09-17

Working on a side project that requires parsing huge pdf files, I need to split them into smaller ones to avoid OOM. qpdf and pdftk are two handy tools that I find pleasant to use.

qpdf --split-pages=<numer_of_pages_per_file> input.pdf output.pdf

pdftk input.pdf cat <from_page>-<to-page> output output.pdf