I have many PDF files that have repetitions of the same slide (or variations thereof) per section. (ie: each section has near-identical copies of the same slide). I'd like to reduce the PDF and strip the extra copies, leaving only 1 page per section.
Here's an example of a PDF. Basically I'd like to automate what he's doing.
Is there any tool, like pdftk or pdfcrop or ghostscript that I could use to only keep the last page of each section in a PDF? A command-line tool would be best!
Edit: uploaded my own example. Here's an image showcasing the problem. See how there are 3 pages that have the "label" set to 2. We have 3 pages that have page index 2, and 3 pages that have page index 3. I'd like to keep the last page that has page index 2, and the last page that has page index 3. I'd like to do that for all PDF "sections" which is what Acrobat calls it!
pdftk Test.pdf dump_data 2>/dev/null | sed -E '/Index:/!d;s/.*: ([0-9]+)[0-9]/\1/'
prints the first page of each section.