Aludel.Interfaces.DocumentConverter.Behaviour behaviour (aludel v0.2.0)

Copy Markdown View Source

Behaviour for document conversion adapters.

Allows swapping between different conversion tools (ImageMagick, etc.) or using test stubs.

Summary

Callbacks

Converts a PDF to PNG format.

Types

convert_result()

@type convert_result() :: {:ok, binary()} | {:error, term()}

document()

@type document() :: %{data: binary(), content_type: String.t()}

Callbacks

convert_pdf_to_png(pdf_data, opts)

@callback convert_pdf_to_png(pdf_data :: binary(), opts :: keyword()) :: convert_result()

Converts a PDF to PNG format.

Returns the PNG binary data on success.