Skip to content

Instantly share code, notes, and snippets.

@miku
Last active May 6, 2016 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miku/c3f6d0c2d7c573d1b80d31fdebf81751 to your computer and use it in GitHub Desktop.
Save miku/c3f6d0c2d7c573d1b80d31fdebf81751 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$#" -ne 1 ] || ! [ -e "$1" ]; then
echo "Usage: $0 FILE"
exit 1
fi
hash pdftotext 2> /dev/null || { echo "pdftotext required"; exit 1; }
F=$(mktemp)
pdftotext -layout "$1" "$F" && cat "$F" && rm -f "$F"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment