pdf generatation function is done with mpdf library.