Method: PDF::Reader::PageLayout#initialize
- Defined in:
- lib/pdf/reader/page_layout.rb
#initialize(runs, mediabox) ⇒ PageLayout
Returns a new instance of PageLayout.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pdf/reader/page_layout.rb', line 11 def initialize(runs, mediabox) raise ArgumentError, "a mediabox must be provided" if mediabox.nil? @runs = merge_runs(runs) @mean_font_size = mean(@runs.map(&:font_size)) || 0 @mean_glyph_width = mean(@runs.map(&:mean_character_width)) || 0 @page_width = mediabox[2] - mediabox[0] @page_height = mediabox[3] - mediabox[1] @x_offset = @runs.map(&:x).sort.first @current_platform_is_rbx_19 = RUBY_DESCRIPTION =~ /\Arubinius 2.0.0/ && RUBY_VERSION >= "1.9.0" end |