Files
fil/docs/snippets/r/config/pdf_hierarchy_config.md
Henrik Jess Nielsen b4c07d3693
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s
Nomad changes
2026-06-01 23:40:55 +02:00

20 lines
426 B
Markdown

```r title="R"
library(kreuzberg)
config <- list(
pdf_options = list(
extract_metadata = TRUE,
hierarchy = list(
enabled = TRUE,
k_clusters = 6L,
include_bbox = TRUE,
ocr_coverage_threshold = 0.8
)
)
)
json <- extract_file_sync("document.pdf", "application/pdf", config)
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
cat(sprintf("Pages: %d\n", length(result$pages)))
```