Pure-Elixir, Phoenix-first PDF/document generation with deterministic layout and pagination.
Summary
Functions
Creates a fixed-position document from a list of pages.
Creates a flow document from a list of content blocks.
Wraps exactly one authored block with a curated external URI or internal page target.
Sets the default logical font for a document.
Registers a document-level embedded file on a document.
Registers an explicit embedded font source on a document.
Registers a four-variant embedded font family on a document.
Registers a logical font name on a document.
Renders the document to an artifact and then applies the configured protection adapter.
Renders the document to an artifact and then applies the configured signing adapter.
Renders the document and returns a Rendro.Artifact which contains the PDF
binary, a deterministic hash, diagnostics, and metadata.
Renders the document and returns the binary along with the fully populated document struct. Useful for inspecting layout or reading populated diagnostics.
Types
@type render_options() :: [render_option()]
Functions
@spec block( Rendro.Text.t() | term(), keyword() ) :: Rendro.Block.t()
@spec document(keyword()) :: Rendro.Document.t()
@spec fixed( [Rendro.Page.t()], keyword() ) :: Rendro.Document.t()
Creates a fixed-position document from a list of pages.
@spec flow( [Rendro.Block.t()], keyword() ) :: Rendro.Document.t()
Creates a flow document from a list of content blocks.
@spec form_field(String.t(), String.t(), keyword()) :: Rendro.Block.t()
@spec link( Rendro.Block.t(), keyword() ) :: Rendro.Block.t()
Wraps exactly one authored block with a curated external URI or internal page target.
@spec metadata(keyword()) :: Rendro.Metadata.t()
@spec page(keyword()) :: Rendro.Page.t()
@spec page_template(keyword()) :: Rendro.PageTemplate.t()
@spec put_default_font(Rendro.Document.t(), Rendro.FontRegistry.logical_name()) :: Rendro.Document.t()
Sets the default logical font for a document.
@spec region(keyword()) :: Rendro.Region.t()
@spec register_embedded_file( Rendro.Document.t(), atom(), {:path, Path.t()} | {:binary, binary()}, keyword() ) :: Rendro.Document.t()
Registers a document-level embedded file on a document.
@spec register_embedded_font( Rendro.Document.t(), Rendro.FontRegistry.logical_name(), {:path, Path.t()} | {:binary, binary()} ) :: Rendro.Document.t()
Registers an explicit embedded font source on a document.
@spec register_embedded_font_family( Rendro.Document.t(), Rendro.FontRegistry.logical_name(), %{ required(Rendro.FontRegistry.embedded_variant()) => {:path, Path.t()} | {:binary, binary()} } ) :: Rendro.Document.t()
Registers a four-variant embedded font family on a document.
@spec register_font( Rendro.Document.t(), Rendro.FontRegistry.logical_name(), keyword() ) :: Rendro.Document.t()
Registers a logical font name on a document.
@spec render(Rendro.Document.t(), render_options()) :: {:ok, binary()} | {:error, Rendro.Error.t()}
@spec render_protected(Rendro.Document.t(), render_options(), keyword()) :: {:ok, Rendro.Artifact.t()} | {:error, Rendro.Error.t()}
Renders the document to an artifact and then applies the configured protection adapter.
@spec render_signed(Rendro.Document.t(), render_options(), keyword()) :: {:ok, Rendro.Artifact.t()} | {:error, Rendro.Error.t()}
Renders the document to an artifact and then applies the configured signing adapter.
@spec render_to_artifact(Rendro.Document.t(), render_options()) :: {:ok, Rendro.Artifact.t()} | {:error, Rendro.Error.t()}
Renders the document and returns a Rendro.Artifact which contains the PDF
binary, a deterministic hash, diagnostics, and metadata.
@spec render_with_diagnostics(Rendro.Document.t(), render_options()) :: {:ok, binary(), Rendro.Document.t()} | {:error, Rendro.Error.t()}
Renders the document and returns the binary along with the fully populated document struct. Useful for inspecting layout or reading populated diagnostics.
final_doc.diagnostics is a list of user-inspectable structured maps. Stable
common keys such as :level and :type are present on every entry, while
event-specific optional keys may include :message, :page_index, :reason,
and :keep_rule. This is the developer-facing layout-debug surface; telemetry
remains the operational span surface.
@spec section(keyword()) :: Rendro.Section.t()
@spec signature_field( String.t(), keyword() ) :: Rendro.Block.t()
@spec table( [Rendro.Table.row()], keyword() ) :: Rendro.Table.t()
@spec text( String.t(), keyword() ) :: Rendro.Text.t()