Skip to content

Instantly share code, notes, and snippets.

@davidaknowles
Last active December 8, 2017 04:08
Show Gist options
  • Save davidaknowles/ba5a2b69f255b748782bd38fe25e4c41 to your computer and use it in GitHub Desktop.
Save davidaknowles/ba5a2b69f255b748782bd38fe25e4c41 to your computer and use it in GitHub Desktop.
Use ghostscript to convert PDFs to version 1.5 (better for pdflatex)
#!/bin/bash
set -e
outfile=$2
if [ "$#" -eq 1 ]; then
outfile=$1
fi
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dCompatibilityLevel=1.5 -sOutputFile=temp.pdf $1
# so you can run on the same file
mv temp.pdf $outfile
#!/bin/bash
set -e
for var in "$@"
do
./ghostscript_pdf_1p7_to_1p5.sh $var
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment