13 lines
416 B
Markdown
13 lines
416 B
Markdown
|
|
```r title="R"
|
||
|
|
library(kreuzberg)
|
||
|
|
|
||
|
|
config <- list(force_ocr = TRUE)
|
||
|
|
|
||
|
|
json <- extract_file_sync("multipage_document.pdf", "application/pdf", config)
|
||
|
|
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||
|
|
|
||
|
|
cat(sprintf("Total pages: %d\n", length(result$pages)))
|
||
|
|
cat(sprintf("Content extracted via OCR: %d characters\n", nchar(result$content)))
|
||
|
|
cat(sprintf("Detected language: %s\n", result$detected_language))
|
||
|
|
```
|