Returns the page count, the PDF file version, every standard
Info-dictionary entry, and POSIXct parses of the two date
fields. The shape mirrors pdftools::pdf_info() to ease
porting.
Arguments
- doc
A
pdfium_docfrompdf_doc_open(), or a character path.- password
Optional password for encrypted PDFs when
docis a path. Ignored whendocis already an openpdfium_doc.
Value
A list with elements:
page_count- integerfile_version- integer; PDFium reports10 * major + minor(e.g.17for PDF 1.7)title,author,subject,keywords,creator,producer,creation_date,mod_date,trapped- charactercreation_date_parsed,mod_date_parsed- POSIXct (UTC),NAwhen the source date is empty or unparseable
Details
Standard Info-dictionary entries are UTF-8 strings; missing
entries appear as "". Date strings come back in the PDF format
"D:YYYYMMDDHHmmSS+HH'mm'" and are also parsed into POSIXct
(UTC) in the creation_date_parsed and mod_date_parsed
slots; parses that fail return NA.
See also
pdf_doc_meta() for arbitrary tag access,
pdf_parse_date() for the date-parser used internally.
Examples
fixture <- system.file("extdata", "fixtures", "shapes.pdf",
package = "pdfium"
)
if (nzchar(fixture)) {
info <- pdf_doc_info(fixture)
info$page_count
info$producer
info$creation_date_parsed
}
#> [1] "2026-05-15 19:12:28 UTC"