Advertisement
Guest User

convertpdf.sh

a guest
Oct 25th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #!/bin/bash
  2. # convertpdf
  3. # convert image(s) to .pdf
  4.  
  5. if [[ -z $1 || $1 == '-h' ]] ; then
  6.         echo "usage : convert /workdir (name)"
  7.         echo "or use this dir : "
  8.         pwd
  9. fi
  10. if [[ $1 && ! $1 == '-h' ]] ; then
  11.                 cd "$1"
  12.         else
  13.                 cd "${PWD}"
  14. fi
  15. if [[ $2 ]] ; then
  16.                 name="$2"
  17.         else
  18.                 name="${PWD##*/}"
  19. fi
  20.  
  21. echo "run ..."
  22. convert -verbose -compress JPEG -quality 90 "./*" "$name".pdf   ## ./ prevent names like "- "
  23. ls
  24.  
  25. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement