Updated pdf generation