Modified method to input parameters to function generate_pdf.

Modified method to input parameters to function generate_pdf. With new method optional parameters will be passed in a dictionary.