Created
November 16, 2015 07:44
-
-
Save diablowu/ae4cf4026524a57bed99 to your computer and use it in GitHub Desktop.
pdf2tiff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| target=$1 | |
| tarball="ghostscript-9.15-linux-x86_64" | |
| if [ -d "$target" ]; | |
| then | |
| echo "the path $target is exist, can't install the file into it." | |
| exit 0 | |
| fi | |
| echo "the files will be installed into $target" | |
| mkdir -p $target | |
| tar -xzvf "./${tarball}.tgz" -C $target | |
| ln -sf "${target}/${tarball}" "${target}/ghostscript" | |
| ln -sf "${target}/ghostscript/gs-915-linux_x86_64" "${target}/ghostscript/gs" | |
| targetcli="${target}/ghostscript/gs" | |
| #echo $targetcli | |
| cliss=`echo $targetcli|sed 's#\/#\\\/#g'` | |
| #echo $cliss | |
| ss="s#{gscli}#$cliss#g" | |
| #echo $ss | |
| cat ./pdf2tiff.tpl|sed $ss > ${target}/pdf2tiff.sh | |
| chmod +x ${target}/pdf2tiff.sh | |
| exit | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gscli={gscli} | |
| pdf=$1 | |
| target=$2 | |
| prefix=$3 | |
| output="${target}/${prefix}_%02d.tif" | |
| $gscli -q -dBATCH \ | |
| -o $output \ | |
| -sDEVICE=tiffg4 \ | |
| -r150 \ | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment