Modified method to give parameters to function generate_pdf

Modified method to give parameters in function generate_pdf. With new method parameters will be passed in a dictionary. At the moment optional parameters are header, footer, margin-top, margin-bottom, margin-left, margin-right. In the future the script will be updated with new optional parameters.