Skip to content

Instantly share code, notes, and snippets.

@jyrkidn
Created June 16, 2015 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyrkidn/cfcefeed858b4807b327 to your computer and use it in GitHub Desktop.
Save jyrkidn/cfcefeed858b4807b327 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Script to remove last pages (2nd argument) in a pdf (first argument)
# Will output a new pdf and open it in Chromium
# Input pdf must have "_test" in the filename
INPUT=$1
REMOVE=$2
echo $INPUT
OUTPUT="${INPUT/_test/}"
pdftk $INPUT cat 1-r$((REMOVE+1)) output $OUTPUT
chromium-browser $OUTPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment