Files
fil/docs/snippets/python/ocr/ocr_paddleocr.md

17 lines
484 B
Markdown
Raw Normal View History

2026-06-01 23:40:55 +02:00
```python title="Python"
from kreuzberg import extract_file_sync, ExtractionConfig, OcrConfig
config: ExtractionConfig = ExtractionConfig(
ocr=OcrConfig(backend="paddleocr", language="en") # model_tier="server" for max accuracy
)
result = extract_file_sync("scanned.pdf", config=config)
content: str = result.content
preview: str = content[:100]
total_length: int = len(content)
print(f"Extracted content (preview): {preview}")
print(f"Total characters: {total_length}")
```