This commit is contained in:
17
docs/snippets/elixir/ocr/image_extraction.md
Normal file
17
docs/snippets/elixir/ocr/image_extraction.md
Normal file
@@ -0,0 +1,17 @@
|
||||
```elixir title="Elixir"
|
||||
config_json = Jason.encode!(%{
|
||||
"images" => %{
|
||||
"extract_images" => true,
|
||||
"target_dpi" => 200,
|
||||
"max_image_dimension" => 2048,
|
||||
"inject_placeholders" => true,
|
||||
"auto_adjust_dpi" => true
|
||||
}
|
||||
})
|
||||
|
||||
{:ok, result} = Kreuzberg.extract_file_sync("document.pdf", "application/pdf", config_json)
|
||||
IO.puts("Content length: #{String.length(result.content)}")
|
||||
if result.images do
|
||||
IO.puts("Images extracted: #{length(result.images)}")
|
||||
end
|
||||
```
|
||||
Reference in New Issue
Block a user