Adding support for PDF output

Not sure if anyone else has a need for this, but I wanted to output PDFs instead of PNGs so added a 'format' parameter as well as parameters for the PDF paper size and orientation.