Re: alléger une image pdf
On lundi 20 mars 2017 20:27:48 CET Vincent Lefevre wrote:
> On 2017-03-19 18:53:15 +0100, bernard.schoenacker@free.fr wrote:
> > je souhaiterai alléger une image pdf, mais comment faire ?
>
> ps2pdf (qui est en fait un wrapper à gs).
En effet, et ça me rappelle un script que j'avais fait :
cat /usr/local/bin/pdfreduce
#!/bin/bash
PDF="$1"
TMPPDF=$(mktemp)
if [ -z "$PDF" ]; then exit 1; fi
pdftops \
-paper match \
-nocrop \
-noshrink \
-nocenter \
-level3 \
-q \
"$PDF" - \
| ps2pdf \
-dUseFlateCompression=true \
-dOptimize=true \
-dPDFSETTINGS=/prepress \
- $TMPPDF
if ! test $?; then exit 1; fi
mv -f $TMPPDF "$PDF"
Reply to: