Extracts the text OCRed by Document AI (DAI)
get_text(
object,
type = "sync",
save_to_file = FALSE,
dest_dir = getwd(),
outfile_stem = NULL
)
either a HTTP response object from
dai_sync()
or the path to a JSON file from
dai_async()
.
one of "sync" or "async", depending on the function used to process the original document.
boolean; whether to save the text as a .txt file
folder path for the .txt output file if save_to_file = TRUE
string to form the stem of the .txt output file
a string (if save_to_file = FALSE
)
if (FALSE) { # \dontrun{
text <- get_text(dai_sync("file.pdf"))
text <- get_text("file.json", type = "async", save_to_file = TRUE)
} # }