Returns the number of pages in doc. Accepts either an open pdfium_doc
or a character path (in which case it opens and closes the document
internally — convenient for one-shot inspection).
Arguments
- doc
A
pdfium_docfrompdf_doc_open(), or a character scalar path.- password
Optional password for encrypted PDFs when
docis a path. Ignored whendocis already an openpdfium_doc.
Examples
fixture <- system.file("extdata", "fixtures", "minimal.pdf",
package = "pdfium"
)
if (nzchar(fixture)) {
pdf_page_count(fixture)
}
#> [1] 1