This commit is contained in:
21
docs/snippets/swift/getting-started/extract_with_ocr.md
Normal file
21
docs/snippets/swift/getting-started/extract_with_ocr.md
Normal file
@@ -0,0 +1,21 @@
|
||||
```swift title="Swift"
|
||||
import Foundation
|
||||
import Kreuzberg
|
||||
import RustBridge
|
||||
|
||||
let configJson = """
|
||||
{
|
||||
"force_ocr": true,
|
||||
"ocr": {
|
||||
"backend": "tesseract",
|
||||
"language": "eng"
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
let config = try extractionConfigFromJson(configJson)
|
||||
let result = try extractFileSync("scanned.pdf", nil, config)
|
||||
|
||||
print(result.content().toString())
|
||||
print("MIME type: \(result.mime_type().toString())")
|
||||
```
|
||||
Reference in New Issue
Block a user