Page Size

A library for determining page sizes.

Functions

get_dimensions

page_size.get_dimensions(size)

View source

Returns the dimensions of the requested page size. Dimensions are in portrait.

Input Type Description
size string The page size.
Return type Description
table Has keys width and height which contain the dimensions in EVPUs.

is_size

page_size.is_size(size)

View source

Checks if the given size is defined.

Input Type Description
size string
Return type Description
boolean true if defined, false if not

get_size

page_size.get_size(width, height)

View source

Determines the page size based on the given dimensions.

Input Type Description
width number Page width in EVPUs.
height number Page height in EVPUs.
Return type Description
string|nil Page size, or nil if no match.

get_page_size

page_size.get_page_size(page)

View source

Determines the page size of an FCPage.

Input Type Description
page FCPage
Return type Description
string|nil Page size, or nil if no match.

set_page_size

page_size.set_page_size(page, size)

View source

Sets the dimensions of an FCPage to the given size. The existing page orientation will be preserved.

Input Type Description
page FCPage
size string

pairs

page_size.pairs()

View source

Return an alphabetical order iterator that yields the following pairs: (string) size (table) dimensions => has keys width and height which contain the dimensions in EVPUs

Return type Description
function