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


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

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#orientationObject


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

def orientation
  @orientation ||= detect_orientation
end