Skip to content

Instantly share code, notes, and snippets.

@andrewgilmartin
Created April 12, 2012 15:39
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 andrewgilmartin/2368311 to your computer and use it in GitHub Desktop.
Save andrewgilmartin/2368311 to your computer and use it in GitHub Desktop.
Simple script to prepare a two column layout PDF from a file of text
#!/bin/bash
# usage: print-text-two-column.sh file1 file2 ...
for f in "$@"
do
o="$(mktemp -q /tmp/$(basename $0).XXXXXX).pdf"
enscript \
--header='$n||$%/$=' \
--word-wrap \
-2 \
-p - \
"$f" \
| pstopdf \
-i \
-o "$o"
open "$o"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment