added PDF output functionality