NativeElixirPdfUtilities.HtmlToPdf.Layout (native_elixir_pdf_utilities v0.5.1)

View Source

Layout engine for the native HTML-to-PDF renderer.

Lays out block text elements, inline text runs, box styling, lists, link annotation bounds, deterministic tables, a documented flexbox/grid subset, image boxes, embedded-font text metrics, and pagination metadata.

Summary

Functions

Converts a styled document tree into a layout tree.

Types

box()

@type box() :: map()

layout_tree()

@type layout_tree() :: %{
  type: :layout,
  page_size: term(),
  margin: term(),
  boxes: [box()]
}

render_option()

Functions

layout(styled_tree, opts \\ [])

@spec layout(term(), term()) ::
  {:ok, layout_tree()}
  | {:error, :invalid_layout | :invalid_margin | :invalid_page_size}

Converts a styled document tree into a layout tree.