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