Test if a file is a pdf
is_pdf(f)
TRUE if pdftools::pdf_info thinks it's a PDF, else FALSE
All PDFs should have a dictionary that contains information about the key metadata about the document. This function uses pdf_info to check if the downloaded file is, in fact, a PDF because too often we get something other than the PDF, e.g., an http status 404 download.