Skip to content

Instantly share code, notes, and snippets.

@ljrk0
Created September 11, 2017 10:05
Show Gist options
  • Save ljrk0/17b136ef1286e1ff9c49e63f9c04b2da to your computer and use it in GitHub Desktop.
Save ljrk0/17b136ef1286e1ff9c49e63f9c04b2da to your computer and use it in GitHub Desktop.
Convert a letter pdf into A4
#! /bin/sh
IN="$1"
OUT="$2"
if [ -z $1 ] || [ -z $2 ]; then
echo "not enough args"
fi
pdf2ps -q -sOutputFile=%stdout% "$IN" | \
gs -dSAFER -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-sPAPERSIZE=a4 -dFIXEDMEDIA -sOutputFile="$OUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment