Files
fil/docs/snippets/kotlin/api/batch_extract_files_sync.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

519 B

import dev.kreuzberg.*
import java.nio.file.Paths

fun main() {
    val config = ExtractionConfig.builder().build()
    val items = listOf(
        BatchFileItem(Paths.get("doc1.pdf"), null),
        BatchFileItem(Paths.get("doc2.docx"), null),
        BatchFileItem(Paths.get("report.pdf"), null),
    )
    val results = Kreuzberg.batchExtractFilesSync(items, config)

    results.forEachIndexed { index, result ->
        println("File $index: ${result.content().length} chars")
    }
}