This commit is contained in:
15
docs/snippets/swift/api/extract_bytes_sync.md
Normal file
15
docs/snippets/swift/api/extract_bytes_sync.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```swift title="Swift"
|
||||
import Foundation
|
||||
import Kreuzberg
|
||||
import RustBridge
|
||||
|
||||
let data = try Data(contentsOf: URL(fileURLWithPath: "document.pdf"))
|
||||
let content = RustVec<UInt8>()
|
||||
for byte in data { content.push(value: byte) }
|
||||
|
||||
let config = try extractionConfigFromJson("{}")
|
||||
let result = try extractBytesSync(content, "application/pdf", config)
|
||||
|
||||
print(result.content().toString())
|
||||
print("Tables: \(result.tables().count)")
|
||||
```
|
||||
Reference in New Issue
Block a user