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,35 @@
```rust title="Rust"
use kreuzberg::{extract_file, ExtractionConfig, OcrConfig};
use kreuzberg::types::OcrElementConfig;
#[tokio::main]
async fn main() -> kreuzberg::Result<()> {
let config = ExtractionConfig {
ocr: Some(OcrConfig {
backend: "paddleocr".to_string(),
language: "en".to_string(),
element_config: Some(OcrElementConfig {
include_elements: true,
..Default::default()
}),
..Default::default()
}),
..Default::default()
};
let result = extract_file("scanned.pdf", None, &config).await?;
if let Some(elements) = &result.ocr_elements {
for element in elements {
println!("Text: {}", element.text);
println!("Confidence: {:.2}", element.confidence.recognition);
println!("Geometry: {:?}", element.geometry);
if let Some(rotation) = &element.rotation {
println!("Rotation: {}°", rotation.angle_degrees);
}
println!();
}
}
Ok(())
}
```