Class: Idml::Elements::Page

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/idml/elements/page.rb

Overview

<Page> — a single page within a Spread. Carries GeometricBounds (y1 x1 y2 x2 in spread coordinates) and ItemTransform that maps page-local coordinates to spread coordinates.

Instance Method Summary collapse

Instance Method Details

#boundsObject



26
27
28
29
30
# File 'lib/idml/elements/page.rb', line 26

def bounds
  return [0.0, 0.0, 0.0, 0.0] unless geometric_bounds

  geometric_bounds.split(/\s+/).map(&:to_f)
end

#heightObject



37
38
39
40
# File 'lib/idml/elements/page.rb', line 37

def height
  b = bounds
  b[2] - b[0]
end

#widthObject



32
33
34
35
# File 'lib/idml/elements/page.rb', line 32

def width
  b = bounds
  b[3] - b[1]
end