Files
fil/docs/snippets/r/ocr/ocr_easyocr.md

17 lines
480 B
Markdown
Raw Permalink Normal View History

2026-06-01 23:40:55 +02:00
```r title="R"
library(kreuzberg)
# Note: EasyOCR backend requires Python to be installed
config <- list(
force_ocr = TRUE,
ocr = list(backend = "easyocr", language = "en")
)
json <- extract_file_sync("document.pdf", "application/pdf", config)
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
cat("EasyOCR extraction:\n")
cat(sprintf("Content length: %d characters\n", nchar(result$content)))
cat(sprintf("Detected language: %s\n", result$detected_language))
```