Fixed problem with pdf generator file permissions by setting HOME to /tmp.