Many hours have I searched for a fast and easy, but mostly a
The R package pdftools and the function pdf_info() provides information on the number of pages in a pdf.
pdf_info()
library(pdftools) pdf_file <- file.path(R.home("doc"), "NEWS.pdf") info <- pdf_info(pdf_file) nbpages <- info[2] nbpages $pages [1] 65