This commit is contained in:
22
docs/snippets/wasm/ocr/cloud_ocr_backend.md
Normal file
22
docs/snippets/wasm/ocr/cloud_ocr_backend.md
Normal file
@@ -0,0 +1,22 @@
|
||||
<!-- snippet:syntax-only -->
|
||||
|
||||
```typescript title="WASM"
|
||||
import init, { extractBytes } from "kreuzberg-wasm";
|
||||
|
||||
await init();
|
||||
|
||||
// Cloud OCR backends are not supported in WASM directly.
|
||||
// WASM runs in a sandboxed environment without direct network access.
|
||||
// To use cloud OCR services, implement a wrapper on your server
|
||||
// or use a cloud platform with built-in OCR integration.
|
||||
|
||||
const cloudOcrConfig = {
|
||||
ocr: {
|
||||
backend: "custom", // Custom backends must be registered via native runtime
|
||||
language: "eng",
|
||||
},
|
||||
};
|
||||
|
||||
// This example shows the configuration structure.
|
||||
// In production, route cloud OCR requests through your backend service.
|
||||
```
|
||||
Reference in New Issue
Block a user