This commit is contained in:
12
docs/snippets/wasm/getting-started/extract_bytes_sync.md
Normal file
12
docs/snippets/wasm/getting-started/extract_bytes_sync.md
Normal file
@@ -0,0 +1,12 @@
|
||||
```typescript title="WASM"
|
||||
import { extractBytes, initWasm } from "@kreuzberg/wasm";
|
||||
|
||||
await initWasm();
|
||||
|
||||
const response = await fetch("document.pdf");
|
||||
const buffer = await response.arrayBuffer();
|
||||
const data = new Uint8Array(buffer);
|
||||
|
||||
const result = await extractBytes(data, "application/pdf");
|
||||
console.log(result.content);
|
||||
```
|
||||
Reference in New Issue
Block a user