pdf function now saves the pdf to the computer