NativeElixirPdfUtilities.HtmlToPdf.Pagination (native_elixir_pdf_utilities v1.1.0)

View Source

Pagination stage for the native HTML-to-PDF renderer.

Milestone 7 splits layout output into deterministic PDF pages with page margins, automatic page breaks, manual page breaks, unbroken flow units, and repeated table headers.

Summary

Functions

Prepares validated placed pages for writing without paginating their content again.

Splits a layout tree into PDF pages.

Types

error_reason()

@type error_reason() :: :invalid_layout | :unsupported_html | :resource_limit_exceeded

page()

@type page() :: %{size: {float(), float()}, boxes: [term()]}

render_option()

Functions

finalize(pages, layout_tree, opts)

@spec finalize([page()], map(), [render_option()]) ::
  {:ok, [page()]}
  | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}

Prepares validated placed pages for writing without paginating their content again.

paginate(layout_tree, opts \\ [])

@spec paginate(term(), [render_option()]) ::
  {:ok, [page()]}
  | {:error,
     {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}

Splits a layout tree into PDF pages.