Pdf.Component.Row (ex_pdf_core v1.0.0)

Copy Markdown View Source

Row component for PDF documents.

Distributes content horizontally in columns by weight. Operates at Document level.

Example

doc
|> Pdf.Component.Row.render({50, 700}, {400, 80}, [
  {1, fn doc, area -> Pdf.text_at(doc, {area.x, area.y - 14}, "Col 1") end},
  {2, fn doc, area -> Pdf.text_at(doc, {area.x, area.y - 14}, "Col 2") end}
], gap: 10)

Summary

Functions

Render a horizontal row at {x, y} with size {w, h}.

Functions

render(doc, arg1, arg2, columns, opts \\ [])

Render a horizontal row at {x, y} with size {w, h}.

columns is a list of {weight, callback} tuples where each callback receives (doc, %{x, y, width, height}).

Options

  • :gap — space between columns (default 0)