14 lines
357 B
Markdown
14 lines
357 B
Markdown
```r title="R"
|
|
library(kreuzberg)
|
|
|
|
config <- list(
|
|
language_detection = list(enabled = TRUE)
|
|
)
|
|
|
|
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 preview: %.60s...\n", result$content))
|
|
```
|