Adding pdf generation functionality