Support for generating PDF

Completes issue #2.