aboutsummaryrefslogtreecommitdiff
path: root/pdfs/asPDF.sh
blob: a03f0aaeef14c9a6a32286277206d71461c3e08b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

outdir="/tmp/pdf"
name="${1%.*}"
ext="${1##*.}"
[ -d "$outdir" ] || mkdir -p "$outdir"

case "$ext" in
	"md")
		pandoc -s -o "$outdir/$name.pdf" "$1" 1>/dev/null 2>&1 ;;
	*)
		lowriter --convert-to pdf --outdir "$outdir" "$1" 1>/dev/null 2>&1 ;;
esac
"$READER" "$outdir/$name.pdf"