I needed to remove the first and last pages of a hold lot of .pdf files on a Mac. It wasn’t that easy to find solutions and so I thought I would document the process:
1 – Install pdftk server which rather helpfully has a Mac installer:
Run the commands
To remove the first page of all the .pdf files in a directory use this command:
for i in *pdf ; do pdftk $i cat 2-end output output/$i ; done
To remove the last page of all the .pdf files in a folder use this command:
for i in *pdf ; do pdftk $i cat 1-r2 output trimmed/$i ; done
Hope this helps someone.