This commit is contained in:
19
docs/snippets/kotlin/config/document_structure_config.md
Normal file
19
docs/snippets/kotlin/config/document_structure_config.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```kotlin title="Kotlin"
|
||||
import dev.kreuzberg.*
|
||||
import java.nio.file.Paths
|
||||
import java.util.Optional
|
||||
|
||||
fun main() {
|
||||
val config = ExtractionConfig.builder()
|
||||
.withIncludeDocumentStructure(true)
|
||||
.build()
|
||||
|
||||
val result = Kreuzberg.extractFileSync(Paths.get("document.pdf"), null, config)
|
||||
val document = result.document()
|
||||
if (document != null) {
|
||||
for (node in document.nodes()) {
|
||||
println(node)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user