Adding Generate PDF code