Added support for generating directly to PDF. Completes request in issue #2.