NativeElixirPdfUtilities.HtmlToPdf.PageGeometry (native_elixir_pdf_utilities v1.1.0)
View SourceShared page-option cascade helpers and vertical layout-box geometry.
Page-size and margin convenience APIs delegate admission to PageGeometryValidator. This module applies canonical geometry to drawing and page-option cascades.
Summary
Functions
Returns the vertical {top, bottom} bounds for a drawing or nonpainting flow marker.
Returns a scalar for uniform margins and the four-sided map for asymmetric margins.
Returns the whole CSS-pixel source height of a validated print fragmentainer; its physical PDF clip retains the original fractional height.
Converts an applicable CSS page-margin value to a renderer margin value.
Converts an applicable CSS page-size descriptor to a renderer page-size value.
Returns pixel-snapped outer, inner and center contours for validated per-edge curved CSS borders.
Returns the content or padding edge clip after subtracting each edge from a validated rounded host.
Merges a later page-margin declaration over an earlier declaration.
Merges extracted page options while cascading partial margin longhands by side.
Resolves a nonnegative renderer margin into top, right, bottom, and left points.
Resolves a renderer page-size value to a positive {width, height} point tuple.
Returns whether a four-sided margin leaves positive printable page geometry.
Types
@type margin_input() :: NativeElixirPdfUtilities.Validators.PageGeometryValidator.margin_input()
@type margins() :: NativeElixirPdfUtilities.Validators.PageGeometryValidator.margins()
@type orientation() :: NativeElixirPdfUtilities.Validators.PageGeometryValidator.orientation()
@type page_size_input() :: NativeElixirPdfUtilities.Validators.PageGeometryValidator.page_size_input()
@type page_size_name() :: NativeElixirPdfUtilities.Validators.PageGeometryValidator.page_size_name()
Functions
Returns the vertical {top, bottom} bounds for a drawing or nonpainting flow marker.
Text bounds account for both the font ascent and the full line height so all rendering stages agree about the vertical space occupied by a line.
Returns a scalar for uniform margins and the four-sided map for asymmetric margins.
Returns the whole CSS-pixel source height of a validated print fragmentainer; its physical PDF clip retains the original fractional height.
Converts an applicable CSS page-margin value to a renderer margin value.
@spec css_page_size_option(String.t()) :: page_size_input() | nil
Converts an applicable CSS page-size descriptor to a renderer page-size value.
Returns pixel-snapped outer, inner and center contours for validated per-edge curved CSS borders.
Returns the content or padding edge clip after subtracting each edge from a validated rounded host.
Merges a later page-margin declaration over an earlier declaration.
Merges extracted page options while cascading partial margin longhands by side.
Resolves a nonnegative renderer margin into top, right, bottom, and left points.
Resolves a renderer page-size value to a positive {width, height} point tuple.
Returns whether a four-sided margin leaves positive printable page geometry.