
Last chance! 50% off unlimited learning
Sale ends in
Plots the entity bounding boxes identified by a Document AI form parser processor onto images of the submitted document. Generates an annotated .png file for each page in the original document.
draw_entities(
object,
type = "sync",
prefix = NULL,
dir = getwd(),
linecol = "red",
linewd = 3,
fontcol = "blue",
fontsize = 4
)
no return value, called for side effects.
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.
string to be prepended to the output png filename.
path to the desired output directory.
color of the bounding box line.
width of the bounding box line.
color of the box numbers.
size of the box numbers.
Not vectorized, but documents can be multi-page.
if (FALSE) {
resp <- dai_sync("page.pdf")
draw_entities(resp)
draw_tokens("page.json", type = "async")
}
Run the code above in your browser using DataLab