Class: EideticPDF::PageStyle
- Inherits:
-
Object
- Object
- EideticPDF::PageStyle
- Defined in:
- lib/epdfpw.rb
Overview
:nodoc:
Constant Summary collapse
- PORTRAIT =
0
- LANDSCAPE =
270
- SIZES =
{ :letter => [612, 792].freeze, :legal => [612, 1008].freeze, :A4 => [595, 842].freeze, :B5 => [499, 708].freeze, :C5 => [459, 649].freeze }
- ROTATIONS =
{ :portrait => PORTRAIT, :landscape => LANDSCAPE }.freeze
Instance Attribute Summary collapse
-
#crop_size ⇒ Object
readonly
Returns the value of attribute crop_size.
-
#landscape ⇒ Object
readonly
Returns the value of attribute landscape.
-
#orientation ⇒ Object
readonly
Returns the value of attribute orientation.
-
#page_size ⇒ Object
readonly
Returns the value of attribute page_size.
-
#rotate ⇒ Object
readonly
Returns the value of attribute rotate.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PageStyle
constructor
A new instance of PageStyle.
Constructor Details
#initialize(options = {}) ⇒ PageStyle
Returns a new instance of PageStyle.
34 35 36 37 38 39 40 41 42 |
# File 'lib/epdfpw.rb', line 34 def initialize(={}) page_size = [:page_size] || :letter crop_size = [:crop_size] || page_size @orientation = [:orientation] || :portrait @page_size = make_size_rectangle(page_size, @orientation) @crop_size = make_size_rectangle(crop_size, @orientation) @landscape = (@orientation == :landscape) @rotate = ROTATIONS[[:rotate] || :portrait] end |
Instance Attribute Details
#crop_size ⇒ Object (readonly)
Returns the value of attribute crop_size.
29 30 31 |
# File 'lib/epdfpw.rb', line 29 def crop_size @crop_size end |
#landscape ⇒ Object (readonly)
Returns the value of attribute landscape.
29 30 31 |
# File 'lib/epdfpw.rb', line 29 def landscape @landscape end |
#orientation ⇒ Object (readonly)
Returns the value of attribute orientation.
29 30 31 |
# File 'lib/epdfpw.rb', line 29 def orientation @orientation end |
#page_size ⇒ Object (readonly)
Returns the value of attribute page_size.
29 30 31 |
# File 'lib/epdfpw.rb', line 29 def page_size @page_size end |
#rotate ⇒ Object (readonly)
Returns the value of attribute rotate.
29 30 31 |
# File 'lib/epdfpw.rb', line 29 def rotate @rotate end |