Class: PDF::Reader::OrientationDetector
- Inherits:
-
Object
- Object
- PDF::Reader::OrientationDetector
- Defined in:
- lib/pdf/reader/orientation_detector.rb
Overview
Small util class for detecting the orientation of a single PDF page. Accounts for any page rotation that is in place.
OrientationDetector.new(:MediaBox => [0,0,612,792]).orientation
=> "portrait"
Instance Method Summary collapse
-
#initialize(attributes) ⇒ OrientationDetector
constructor
A new instance of OrientationDetector.
- #orientation ⇒ Object
Constructor Details
#initialize(attributes) ⇒ OrientationDetector
Returns a new instance of OrientationDetector.
11 12 13 |
# File 'lib/pdf/reader/orientation_detector.rb', line 11 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#orientation ⇒ Object
15 16 17 |
# File 'lib/pdf/reader/orientation_detector.rb', line 15 def orientation @orientation ||= detect_orientation end |