This commit is contained in:
15
docs/snippets/wasm/config/document_structure_config.md
Normal file
15
docs/snippets/wasm/config/document_structure_config.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```typescript title="Document Structure Config (WASM)"
|
||||
import { extractBytes } from "kreuzberg-wasm";
|
||||
|
||||
const config = {
|
||||
includeDocumentStructure: true,
|
||||
};
|
||||
|
||||
const result = extractBytes(fileBuffer, "application/pdf", config);
|
||||
|
||||
if (result.document) {
|
||||
for (const node of result.document.nodes) {
|
||||
console.log(`[${node.content.nodeType}]`);
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user