This commit is contained in:
18
docs/snippets/python/config/pdf_config.md
Normal file
18
docs/snippets/python/config/pdf_config.md
Normal file
@@ -0,0 +1,18 @@
|
||||
```python title="Python"
|
||||
import asyncio
|
||||
from kreuzberg import ExtractionConfig, PdfConfig, HierarchyConfig, extract_file
|
||||
|
||||
async def main() -> None:
|
||||
config: ExtractionConfig = ExtractionConfig(
|
||||
pdf_options=PdfConfig(
|
||||
extract_images=True,
|
||||
extract_metadata=True,
|
||||
passwords=["password1", "password2"],
|
||||
hierarchy=HierarchyConfig(enabled=True, k_clusters=6)
|
||||
)
|
||||
)
|
||||
result = await extract_file("document.pdf", config=config)
|
||||
print(f"Content: {result.content[:100]}")
|
||||
|
||||
asyncio.run(main())
|
||||
```
|
||||
Reference in New Issue
Block a user