NativeElixirPdfUtilities.Validators.PrintMediaValidator (native_elixir_pdf_utilities v1.1.0)
View SourceMedia predicates share one bounded grammar. Lengths are CSS pixels. Stylesheet media dimensions describe the requested page box before CSS @page size. The legacy responsive source-size context uses the effective printable area. Embedded media dimensions include gutters; client layout is separate.
Summary
Functions
Returns the environment part of a stylesheet cache key, omitting invariant media types.
Builds media context from a nonnegative child viewport in points, including scrollbar gutters.
Returns a validated print context from effective renderer options.
Evaluates a media query list against a validated print context. Unknown features do not match.
Checks stylesheet applicability and diagnoses viewport-qualified page defaults during page preparation.
Returns stylesheet media context from the requested page box before CSS @page size.
Selects bounded nested media blocks without changing their source order. Nil retains the legacy media-type-only API.
Resolves a nonnegative CSS source-size length to CSS pixels, or returns :error.
Validates explicit print viewport and deterministic image density options.
Types
Functions
@spec cache_context(String.t(), context() | nil | :unpositioned) :: context() | nil | :unpositioned | :print
Returns the environment part of a stylesheet cache key, omitting invariant media types.
@spec client_context(keyword(), {number(), number()}) :: {:ok, context()} | {:error, {atom(), map()}}
Builds media context from a nonnegative child viewport in points, including scrollbar gutters.
Returns a validated print context from effective renderer options.
Evaluates a media query list against a validated print context. Unknown features do not match.
Checks stylesheet applicability and diagnoses viewport-qualified page defaults during page preparation.
Returns stylesheet media context from the requested page box before CSS @page size.
@spec select_rules(String.t(), context() | nil | :unpositioned) :: {:ok, String.t()} | {:error, :invalid_css}
Selects bounded nested media blocks without changing their source order. Nil retains the legacy media-type-only API.
Resolves a nonnegative CSS source-size length to CSS pixels, or returns :error.
Validates explicit print viewport and deterministic image density options.