added compresspdf.sh
This commit is contained in:
parent
261874224e
commit
e4e7ef3344
21
compresspdf.sh
Normal file
21
compresspdf.sh
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
pdffile=$1;
|
||||||
|
dpi=$2
|
||||||
|
|
||||||
|
gs \
|
||||||
|
-o "${pdffile%.pdf}-resampled.pdf" \
|
||||||
|
-sDEVICE=pdfwrite \
|
||||||
|
-dDownsampleColorImages=true \
|
||||||
|
-dDownsampleGrayImages=true \
|
||||||
|
-dDownsampleMonoImages=true \
|
||||||
|
-dColorImageResolution=$dpi \
|
||||||
|
-dGrayImageResolution=$dpi \
|
||||||
|
-dMonoImageResolution=$dpi \
|
||||||
|
-dColorImageDownsampleThreshold=1.0 \
|
||||||
|
-dGrayImageDownsampleThreshold=1.0 \
|
||||||
|
-dMonoImageDownsampleThreshold=1.0 \
|
||||||
|
"${pdffile}"
|
||||||
|
|
||||||
|
# how to run it:
|
||||||
|
# ./compresspdf.sh output.pdf 300
|
Loading…
Reference in New Issue
Block a user