Skip to content

Instantly share code, notes, and snippets.

@niltonvasques
Created July 18, 2017 03:05
Show Gist options
  • Select an option

  • Save niltonvasques/fc2ebd9ca6ac5503d4b0bfa54e9b2ab7 to your computer and use it in GitHub Desktop.

Select an option

Save niltonvasques/fc2ebd9ca6ac5503d4b0bfa54e9b2ab7 to your computer and use it in GitHub Desktop.
Split a pdf in individual pdf files
#!/bin/bash
PAGES=17
PDF_FILE=full.pdf
for i in $(seq 1 $PAGES); do
gs -dBATCH -sOutputFile="page$i.pdf" -dFirstPage=$i -dLastPage=$i -sDEVICE=pdfwrite $PDF_FILE;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment