This commit is contained in:
17
docs/snippets/wasm/ocr/ocr_force_all_pages.md
Normal file
17
docs/snippets/wasm/ocr/ocr_force_all_pages.md
Normal file
@@ -0,0 +1,17 @@
|
||||
```typescript title="WASM"
|
||||
import init, { extractBytes } from "kreuzberg-wasm";
|
||||
|
||||
await init();
|
||||
|
||||
const documentData = await fetch("document.pdf").then((res) => res.arrayBuffer());
|
||||
|
||||
const result = await extractBytes(documentData, "application/pdf", {
|
||||
force_ocr: true,
|
||||
ocr: {
|
||||
backend: "tesseract",
|
||||
language: "eng",
|
||||
},
|
||||
});
|
||||
|
||||
console.log(result.content);
|
||||
```
|
||||
Reference in New Issue
Block a user