for generating pdf from data