Module: Uniword::Wordprocessingml::PageDefaults

Defined in:
lib/uniword/wordprocessingml/page_defaults.rb

Overview

Shared page layout defaults.

Provides canonical values for page size, margins, columns, and docGrid used by both builder and reconciler.

Constant Summary collapse

LETTER_WIDTH =
12_240
LETTER_HEIGHT =
15_840
DEFAULT_MARGINS =
{
  top: 1440, right: 1440, bottom: 1440, left: 1440,
  header: 720, footer: 720, gutter: 0,
}.freeze
DEFAULT_COL_SPACE =
720
DEFAULT_LINE_PITCH =
360

Class Method Summary collapse

Class Method Details

.default_columnsObject



30
31
32
# File 'lib/uniword/wordprocessingml/page_defaults.rb', line 30

def self.default_columns
  Wordprocessingml::Columns.new(space: DEFAULT_COL_SPACE)
end

.default_doc_gridObject



34
35
36
# File 'lib/uniword/wordprocessingml/page_defaults.rb', line 34

def self.default_doc_grid
  Wordprocessingml::DocGrid.new(line_pitch: DEFAULT_LINE_PITCH)
end

.default_page_marginsObject



26
27
28
# File 'lib/uniword/wordprocessingml/page_defaults.rb', line 26

def self.default_page_margins
  Wordprocessingml::PageMargins.new(**DEFAULT_MARGINS)
end

.default_page_sizeObject



21
22
23
24
# File 'lib/uniword/wordprocessingml/page_defaults.rb', line 21

def self.default_page_size
  Wordprocessingml::PageSize.new(width: LETTER_WIDTH,
                                 height: LETTER_HEIGHT)
end