generate PDF and HTML