This commit is contained in:
19
docs/snippets/elixir/getting-started/extract_file.md
Normal file
19
docs/snippets/elixir/getting-started/extract_file.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```elixir title="Elixir"
|
||||
defmodule ExtractFile do
|
||||
def show_extraction_details do
|
||||
# Extract from a file
|
||||
case Kreuzberg.extract_file_sync("document.pdf", nil, nil) do
|
||||
{:ok, result} ->
|
||||
# Result is a string containing extracted content
|
||||
IO.puts("Content length: #{String.length(result)} characters")
|
||||
IO.puts("---")
|
||||
IO.puts(result)
|
||||
:ok
|
||||
|
||||
{:error, reason} ->
|
||||
IO.puts("Failed to extract: #{reason}")
|
||||
:error
|
||||
end
|
||||
end
|
||||
end
|
||||
```
|
||||
Reference in New Issue
Block a user