Files
fil/docs/snippets/r/config/ocr_dpi_config.md

17 lines
554 B
Markdown
Raw Normal View History

2026-06-01 23:40:55 +02:00
```r title="R"
library(kreuzberg)
# Tesseract OCR via the kreuzberg R bindings does not expose a DPI setting in
# the high-level config; PDF rasterization DPI is determined by the pipeline.
# This example demonstrates running Tesseract OCR end-to-end on a PDF.
config <- list(
force_ocr = TRUE,
ocr = list(backend = "tesseract", language = "eng")
)
json <- extract_file_sync("document.pdf", "application/pdf", config)
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
cat(sprintf("Characters extracted: %d\n", nchar(result$content)))
```