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
-
#notes_height_cm ⇒ Object
Convert the notes panel height from CSS pixels to centimetres.
-
#slide_height_cm ⇒ Object
Convert the slide height from CSS pixels to centimetres.
-
#slide_width_cm ⇒ Object
Convert the slide width from CSS pixels to centimetres.
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
Convert the notes panel height from CSS pixels to centimetres.
33 |
# File 'lib/presently/export.rb', line 33 def notes_height_cm = (notes_height_px / PX_PER_CM).round(4) |
#slide_height_cm ⇒ Object
Convert the slide height from CSS pixels to centimetres.
29 |
# File 'lib/presently/export.rb', line 29 def = ( / PX_PER_CM).round(4) |
#slide_width_cm ⇒ Object
Convert the slide width from CSS pixels to centimetres.
25 |
# File 'lib/presently/export.rb', line 25 def = ( / PX_PER_CM).round(4) |