R/utils-pdftk.R

Defines functions get_pdftk_metadata

# SPDX-License-Identifier: MIT

get_pdftk_metadata <- function(filename) {
    f <- tempfile(fileext = ".txt")
    on.exit(unlink(f))
    cmd <- pdftk()
    filename <- shQuote(normalizePath(filename, mustWork = TRUE))
    args <- c(filename, "dump_data_utf8", "output", f)
    results <- xmpdf_system2(cmd, args)
    brio::read_lines(f)
}

Try the xmpdf package in your browser

Any scripts or data that you put into this service are public.

xmpdf documentation built on July 4, 2024, 9:08 a.m.