Files

20 lines
498 B
Markdown
Raw Permalink Normal View History

2026-06-01 23:40:55 +02:00
```elixir title="Elixir"
defmodule ExtractWithOcr do
def extract_scanned_document do
# Build configuration with OCR settings as JSON string
config = ~s({"ocr": {"backend": "tesseract", "language": "eng"}})
case Kreuzberg.extract_file_sync("scanned.pdf", nil, config) do
{:ok, result} ->
IO.puts("Extracted via OCR:")
IO.puts(result)
:ok
{:error, reason} ->
IO.puts("OCR extraction failed: #{reason}")
:error
end
end
end
```