put pdf generation in a class