This commit is contained in:
16
docs/snippets/php/config/document_structure_config.md
Normal file
16
docs/snippets/php/config/document_structure_config.md
Normal file
@@ -0,0 +1,16 @@
|
||||
```php title="Document Structure Config (PHP)"
|
||||
<?php
|
||||
use Kreuzberg\ExtractionConfig;
|
||||
use Kreuzberg\Kreuzberg;
|
||||
|
||||
$config = new ExtractionConfig(includeDocumentStructure: true);
|
||||
|
||||
$result = Kreuzberg::extractFileSync('document.pdf', $config);
|
||||
|
||||
if ($result->document !== null) {
|
||||
foreach ($result->document->nodes as $node) {
|
||||
echo "[{$node->content->nodeType}]\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
```
|
||||
Reference in New Issue
Block a user