Modified method to input parameters to function generate_pdf.