Advertisement
Guest User

pdfpextr

a guest
Aug 12th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. function pdfpextr()                                                                                                                    
  2. {
  3.     # function based on a function by Kurt Pfeifle
  4.     # http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf
  5.     #     $1 is the input file
  6.     #     $2 is the first page of the range to extract
  7.     #     $3 is the last page of the range to extract
  8.     #     $4 is the output file minus the extension
  9.     # ex: pdfpextr foo.pdf 5 10 foo1
  10.  
  11.     gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
  12.        -dFirstPage=${2} \
  13.        -dLastPage=${3} \
  14.        -sOutputFile=${4}.pdf \
  15.        ${1}
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement