This commit is contained in:
13
docs/snippets/elixir/getting-started/extract_file.exs
Normal file
13
docs/snippets/elixir/getting-started/extract_file.exs
Normal file
@@ -0,0 +1,13 @@
|
||||
```elixir title="Elixir"
|
||||
# Extract from different file types (PDF, DOCX, etc.)
|
||||
|
||||
case Kreuzberg.extract_file("document.pdf") do
|
||||
{:ok, result} ->
|
||||
IO.puts("Content: #{result.content}")
|
||||
IO.puts("Format: #{inspect(result.metadata.format)}")
|
||||
IO.puts("Tables: #{length(result.tables)}")
|
||||
|
||||
{:error, reason} ->
|
||||
IO.puts("Extraction failed: #{inspect(reason)}")
|
||||
end
|
||||
```
|
||||
Reference in New Issue
Block a user