ModraUp Ruby API Documentation Ruby API Reference

Class: Layout::PageInfo

Inherits:
Object
  • Object
show all

Overview

Page size and margins in inches (written as 420.mm). Paper size ranges from 100 to 1200 mm, and margins range from 0 to 40 mm.

Note: ModraUp extension. Uniform margin on all sides: the four *_margin values read the same value, and setting any one side sets all four. Document-wide uniformity, written to affect every page.

Examples:

A3 Landscape

info = ModraUp.active_model.layout_document.page_info
info.width = 420.mm
info.height = 297.mm
info.left_margin = 10.mm

Instance Method Summary # collapse

Instance Method Details

page_info.width ⇒ Length

Page width.

Returns:

  • (Length)

Examples:

ModraUp.active_model.layout_document.page_info.width.to_mm

page_info.width = width

Set the paper width, one step undo.

Parameters:

  • width (Length, Numeric) In inches, 100~1200 mm.

Returns:

  • (Length, Numeric)

Raises:

  • [ArgumentError] Out of range

Examples:

ModraUp.active_model.layout_document.page_info.width = 594.mm

page_info.height ⇒ Length

Page height.

Returns:

  • (Length)

Examples:

ModraUp.active_model.layout_document.page_info.height.to_mm

page_info.height = height

Set the page height, with one-step undo.

Parameters:

  • height (Length, Numeric) In inches, 100~1200 mm.

Returns:

  • (Length, Numeric)

Raises:

  • [ArgumentError] Out of range

Examples:

ModraUp.active_model.layout_document.page_info.height = 420.mm

page_info.left_margin ⇒ Length

Default page margin (equal on all sides).

Returns:

  • (Length)
Note: ModraUp extension. Uniform margins.

Examples:

ModraUp.active_model.layout_document.page_info.left_margin.to_mm  #=> 10.0

page_info.right_margin ⇒ Length

Default page margin (equal on all sides).

Returns:

  • (Length)
Note: ModraUp extension. Uniform margins.

Examples:

ModraUp.active_model.layout_document.page_info.right_margin

page_info.top_margin ⇒ Length

Default page margin (equal on all sides).

Returns:

  • (Length)
Note: ModraUp extension. Uniform margins.

Examples:

ModraUp.active_model.layout_document.page_info.top_margin

page_info.bottom_margin ⇒ Length

Default page margin (equal on all sides).

Returns:

  • (Length)
Note: ModraUp extension. Uniform margins.

Examples:

ModraUp.active_model.layout_document.page_info.bottom_margin

page_info.left_margin = margin

Set the page margin, changing all four sides simultaneously, with one-step undo.

Parameters:

  • margin (Length, Numeric) inches, 0~40 mm

Returns:

  • (Length, Numeric)

Raises:

  • [ArgumentError] Out of range
Note: ModraUp extension. Set any edge to set all four edges.

Examples:

ModraUp.active_model.layout_document.page_info.left_margin = 15.mm

page_info.right_margin = margin

Set the page margin, changing all four sides simultaneously.

Parameters:

  • margin (Length, Numeric)

Returns:

  • (Length, Numeric)
Note: ModraUp extension. Set any edge to set all four edges.

Examples:

ModraUp.active_model.layout_document.page_info.right_margin = 15.mm

page_info.top_margin = margin

Set the page margin, changing all four sides simultaneously.

Parameters:

  • margin (Length, Numeric)

Returns:

  • (Length, Numeric)
Note: ModraUp extension. Set any edge to set all four edges.

Examples:

ModraUp.active_model.layout_document.page_info.top_margin = 15.mm

page_info.bottom_margin = margin

Set the page margin, changing all four sides simultaneously.

Parameters:

  • margin (Length, Numeric)

Returns:

  • (Length, Numeric)
Note: ModraUp extension. Set any edge to set all four edges.

Examples:

ModraUp.active_model.layout_document.page_info.bottom_margin = 15.mm

page_info.inspect ⇒ String

A brief description.

Returns:

  • (String)

Examples:

ModraUp.active_model.layout_document.page_info.inspect