Represents page margins.
Margins can be created from:
- one number, applied to every side;
- a keyword list with individual values;
- an existing
PaperForge.Marginsstruct.
Examples
PaperForge.Margins.new(72)
PaperForge.Margins.new(
top: 40,
right: 50,
bottom: 40,
left: 50
)
Summary
Functions
Returns the content height for a page.
Returns the content width for a page.
Returns the total horizontal margin.
Creates margins with zero on every side.
Creates margins from one value, a keyword list, or an existing margins struct.
Converts margins to a keyword list.
Validates that margins fit inside a page.
Returns the total vertical margin.
Types
Functions
Returns the content height for a page.
Raises when the margins consume all available page height.
Returns the content width for a page.
Raises when the margins consume all available page width.
Returns the total horizontal margin.
This is the sum of the left and right margins.
@spec new() :: t()
Creates margins with zero on every side.
Creates margins from one value, a keyword list, or an existing margins struct.
A numeric value is applied to all four sides.
Missing keyword values default to zero.
Converts margins to a keyword list.
Validates that margins fit inside a page.
Returns the margins unchanged when valid.
Returns the total vertical margin.
This is the sum of the top and bottom margins.