Class: Presently::Export::PageSize
- Inherits:
-
Struct
- Object
- Struct
- Presently::Export::PageSize
- 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
-
#notes_height_px ⇒ Object
Returns the value of attribute notes_height_px.
-
#slide_height_px ⇒ Object
Returns the value of attribute slide_height_px.
-
#slide_width_px ⇒ Object
Returns the value of attribute slide_width_px.
Instance Method Summary collapse
Instance Attribute Details
#notes_height_px ⇒ Object
Returns the value of attribute notes_height_px
20 21 22 |
# File 'lib/presently/export.rb', line 20 def notes_height_px @notes_height_px end |
#slide_height_px ⇒ Object
Returns the value of attribute slide_height_px
20 21 22 |
# File 'lib/presently/export.rb', line 20 def @slide_height_px end |
#slide_width_px ⇒ Object
Returns the value of attribute slide_width_px
20 21 22 |
# File 'lib/presently/export.rb', line 20 def @slide_width_px end |
Instance Method Details
#notes_height_cm ⇒ Object
25 |
# File 'lib/presently/export.rb', line 25 def notes_height_cm = (notes_height_px / PX_PER_CM).round(4) |
#slide_height_cm ⇒ Object
24 |
# File 'lib/presently/export.rb', line 24 def = ( / PX_PER_CM).round(4) |
#slide_width_cm ⇒ Object
23 |
# File 'lib/presently/export.rb', line 23 def = ( / PX_PER_CM).round(4) |