How to prepend a PDF to a bunch of other PDFs

Dear Reader,

Imagine that you are entering a brave new world where marking is being doing using PDF submissions, Xournal and one of those tablet input pens.  In order to give out only one document to the students you think it is a good idea to prepend the marking and feedback matrix to your student’s PDF submissions.

Using the excellent pdftk software and some bash scripting this can be done easily.  Observe:

# puts marking matrix in front of PDF for all PDFs in a directory

if [ -z “$1” ]; then
echo usage: $0 markingmatrix.pdf


for FILENAME in $( ls *.pdf)
pdftk $MATRIX $FILENAME cat output matrix_$FILENAME
rm matrix_$MATRIX

This doesn’t of course solve the problem of your feedback looking like it was written by a three year old since the tablet is the size of a postcard and your screen is considerably bigger…. however it does make the electronic marking process a bit easier.


One thought on “How to prepend a PDF to a bunch of other PDFs

  1. Pingback: Electronic Marking using a Tablet Input Device « Software Configuration Tips from an Idiot

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s