Guest User

ghostscript

a guest
Nov 30th, 2012
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #
  4. # /Share/Scans/ReducePDF.sh
  5. #
  6. # Script Created By ...redacted....
  7. #
  8. # This script is used to reduce the size of PDF files using Ghost Script and place them into a new folder.
  9. #
  10. # Ghost Script usually has a slew of errors on output, this is normal, you can ignore these.
  11. #
  12.  
  13. #monitor folder for new Scans
  14.  
  15. #resize PDF with Ghost Script
  16. gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${1%\.pdf}-smaller.pdf $1 > /dev/null
  17.  
  18. #move reduced file to /Share/Scans/Smaller Folder
  19. mv *-smaller.pdf ./Smaller/$1-smaller.pdf
Advertisement
Add Comment
Please, Sign In to add comment