Class: PDF::Reader::OrientationDetector

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(attributes) ⇒ OrientationDetector

Returns a new instance of OrientationDetector.



12
13
14
# File 'lib/pdf/reader/orientation_detector.rb', line 12

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#orientationObject



16
17
18
# File 'lib/pdf/reader/orientation_detector.rb', line 16

def orientation
  @orientation ||= detect_orientation
end