Files
fil/docs/snippets/swift/ocr/cloud_ocr_backend.md

23 lines
501 B
Markdown
Raw Permalink Normal View History

2026-06-01 23:40:55 +02:00
```swift title="Swift"
import Foundation
import Kreuzberg
import RustBridge
// Custom/cloud OCR backends are registered via the Rust plugin system.
// From Swift, select a registered custom backend by name through the
// JSON configuration:
let configJson = """
{
"ocr": {
"backend": "custom",
"language": "eng"
}
}
"""
let config = try extractionConfigFromJson(configJson)
let result = try extractFileSync("scanned.pdf", nil, config)
print(result.content().toString())
```