This commit is contained in:
17
docs/snippets/r/config/tesseract_config.md
Normal file
17
docs/snippets/r/config/tesseract_config.md
Normal file
@@ -0,0 +1,17 @@
|
||||
```r title="R"
|
||||
library(kreuzberg)
|
||||
|
||||
config <- list(
|
||||
force_ocr = TRUE,
|
||||
ocr = list(
|
||||
backend = "tesseract",
|
||||
language = "eng+deu"
|
||||
)
|
||||
)
|
||||
|
||||
json <- extract_file_sync("document.pdf", "application/pdf", config)
|
||||
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||||
|
||||
cat(sprintf("Detected language: %s\n", result$detected_language))
|
||||
cat(sprintf("Content length: %d characters\n", nchar(result$content)))
|
||||
```
|
||||
Reference in New Issue
Block a user