Browse Source

adding resample to the toolbox

master
mb@ts 3 years ago
parent
commit
cf80180f2d
  1. 12
      command-line/tools/README.md
  2. 18
      command-line/tools/resample.sh

12
command-line/tools/README.md

@ -34,6 +34,18 @@ Usage:
Link: <http://osp.kitchen/tools/pdfutils/>
## OSP-tools: `resample.sh`
Dependencies:
- `gs` (Ghostscript)
This will change the resolution of a PDF.
Usage:
./resample input.pdf 150
## Custom VR tools: `make-images-bw.sh`
Dependencies:

18
command-line/tools/resample.sh

@ -0,0 +1,18 @@
#! /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}"
Loading…
Cancel
Save