Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created August 1, 2016 04:42
Show Gist options
  • Save penguin2716/7b177c475c673c4056848ed1eac7eea6 to your computer and use it in GitHub Desktop.
Save penguin2716/7b177c475c673c4056848ed1eac7eea6 to your computer and use it in GitHub Desktop.
convert a PDF file to outline PDF
#!/bin/bash
if [ "x$1" = "x" -o "x$2" = "x" ]; then
echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2
exit 1
fi
# change 'ps2write' to 'pswrite' if errors
gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=- -q -dbatch \
-dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment