is_pdf: Test if a file is a pdf

Description Usage Arguments Details Value

View source: R/download_pdf.R

Description

Test if a file is a pdf

Usage

1
is_pdf(f)

Arguments

f

Path to a file to test

Details

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.

Value

TRUE if pdftools::pdf_info thinks it's a PDF, else FALSE


Defenders-ESC/pdfdown documentation built on May 6, 2019, 1:58 p.m.