Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
```php title="PHP"
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use function Kreuzberg\extract_file;
use Kreuzberg\Config\ExtractionConfig;
use Kreuzberg\Config\PdfConfig;
/**
* PDF configuration with hierarchy detection
*/
$config = new ExtractionConfig(
pdf: new PdfConfig(
extractImages: true,
extractMetadata: true,
passwords: ['password1', 'password2'],
hierarchy: [
'enabled' => true,
'k_clusters' => 6,
'include_bbox' => true,
'ocr_coverage_threshold' => 0.5
]
)
);
$result = extract_file('document.pdf', config: $config);
echo "Content length: " . strlen($result->content) . " characters\n";
echo "Metadata: " . implode(', ', array_keys((array) $result->metadata)) . "\n";
```