This commit is contained in:
19
docs/snippets/r/config/pdf_hierarchy_config.md
Normal file
19
docs/snippets/r/config/pdf_hierarchy_config.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```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)))
|
||||
```
|
||||
Reference in New Issue
Block a user