Using the aforementioned command-line PDF tools, I was able to compile a workflow that does the following:
- Take an input PDF (or PDFs) and generate a new file minus the first page
- Move the original PDF to the trash
- Rename the new file to match the original file
First I installed the PDF tools as instructed. The key tool in this case is pdfsplit.
In Automator, I created a new service to receive selected PDF files in the Finder.
I added the "Run Shell Script" action, with the shell as "/bin/bash" and "pass input" set to "as arguments." I then wrote the following simple script:
for f in "$@"
do
/usr/local/bin/pdfsplit "$f" 2- > "$f".tmp
done
I added a "Move Finder Items to Trash" action for the original file and a "Replace Text" action to remove the .tmp extension from the new file.
To run the process with a folder input, the script would be something like:
cd "$@"
for f in *pdf
do
/usr/local/bin/pdfsplit "$f" 2- > "$f".tmp
done
I suppose I could have done everything in the shell script, including the remove and rename. But the rm command can be dangerous, and I prefer moving the original file to the trash instead.
The script can be modified to do more than simply remove x number of pages. I've developed a similar program to batch crop and combine PDFs, for example. Check out the manual on pdfsplit and its accompanying tools for more info.
Delete(Backspace). So if it's not too many files, that is probably the easiest solution. – Daniel Beck♦ Feb 2 '12 at 12:07