Class: Presently::Export::PageSize

Inherits:
Struct
  • Object
show all
Defined in:
lib/presently/export.rb

Overview

Holds slide canvas and notes panel dimensions, and converts between CSS pixels and centimetres for WebDriver print (96 px/inch × 2.54 cm/inch).

Constant Summary collapse

PX_PER_CM =
96.0 / 2.54
DEFAULT =
PageSize.new(slide_width_px: 1920, slide_height_px: 1080, notes_height_px: 300)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#notes_height_pxObject

Returns the value of attribute notes_height_px

Returns:

  • (Object)

    the current value of notes_height_px



20
21
22
# File 'lib/presently/export.rb', line 20

def notes_height_px
  @notes_height_px
end

#slide_height_pxObject

Returns the value of attribute slide_height_px

Returns:

  • (Object)

    the current value of slide_height_px



20
21
22
# File 'lib/presently/export.rb', line 20

def slide_height_px
  @slide_height_px
end

#slide_width_pxObject

Returns the value of attribute slide_width_px

Returns:

  • (Object)

    the current value of slide_width_px



20
21
22
# File 'lib/presently/export.rb', line 20

def slide_width_px
  @slide_width_px
end

Instance Method Details

#notes_height_cmObject



25
# File 'lib/presently/export.rb', line 25

def notes_height_cm = (notes_height_px / PX_PER_CM).round(4)

#slide_height_cmObject



24
# File 'lib/presently/export.rb', line 24

def slide_height_cm = (slide_height_px / PX_PER_CM).round(4)

#slide_width_cmObject



23
# File 'lib/presently/export.rb', line 23

def slide_width_cm  = (slide_width_px  / PX_PER_CM).round(4)