shithub: rech

ref: f3cb4b36831e141994b9508139f6c2e4d69ebbe6
dir: /bin/genpdfmark/

View raw version
#!/bin/rc
# generate pdfmark files for PDF metadata
# $1 is the invoice number
# assume temp files already in /tmp

rfork e

# read and construct date
dt=`{cat invoice/$1/date}
dt=`{date -u -f 'YYYYMMDDhhmmss+00''00''' $dt}

# read subject line
subject=`{cat /tmp/pre.tmp /tmp/msg.tmp | tbl | nroff -ms | sed '/^$/d' | sed 1q}

echo '[ /Author (Joel Fridolin Meyer)'
echo '  /Subject ('^$"subject^')'
echo '  /CreationDate (D:'^$dt^')'
echo '  /ModDate (D:'^$dt^')'
echo '  /DOCINFO pdfmark'