Look back at the code you have written sure you aren't getting any exception because you wrapped your exception handling with "no-op". It's like crime in programming!!. If you print the exception you will get this
doesn't have any filename where you want the PDF to be written.
And these lines
subject: source cod for selection and saving the pdf document