n_pages() returns the number of pages in the (pdf) file(s).
n_pages(filename, use_names = TRUE)
n_pages_exiftool(filename, use_names = TRUE)
n_pages_qpdf(filename, use_names = TRUE)
n_pages_pdftk(filename, use_names = TRUE)
n_pages_gs(filename, use_names = TRUE)Character vector of filenames.
If TRUE (default) use filename as the names of the result.
An integer vector of number of pages within each file.
n_pages() will try to use the following helper functions in the following order:
n_pages_qpdf() which wraps qpdf::pdf_length()
n_pages_exiftool() which wraps exiftool command-line tool
n_pages_pdftk() which wraps pdftk command-line tool
n_pages_gs() which wraps ghostscript command-line tool
supports_n_pages() detects support for this feature.