Class: Pdfrb::Destination::FitRectangle

Inherits:
Fit
  • Object
show all
Defined in:
lib/pdfrb/destination/fit.rb

Overview

/FitR left bottom right top — fit the specified rectangle.

Instance Attribute Summary collapse

Attributes inherited from Fit

#page_ref

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fit

[], register, register_as, registry, types

Constructor Details

#initialize(page_ref, left:, bottom:, right:, top:) ⇒ FitRectangle

Returns a new instance of FitRectangle.



100
101
102
103
104
105
106
# File 'lib/pdfrb/destination/fit.rb', line 100

def initialize(page_ref, left:, bottom:, right:, top:)
  super(page_ref)
  @left = left
  @bottom = bottom
  @right = right
  @top = top
end

Instance Attribute Details

#bottomObject (readonly)

Returns the value of attribute bottom.



98
99
100
# File 'lib/pdfrb/destination/fit.rb', line 98

def bottom
  @bottom
end

#leftObject (readonly)

Returns the value of attribute left.



98
99
100
# File 'lib/pdfrb/destination/fit.rb', line 98

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



98
99
100
# File 'lib/pdfrb/destination/fit.rb', line 98

def right
  @right
end

#topObject (readonly)

Returns the value of attribute top.



98
99
100
# File 'lib/pdfrb/destination/fit.rb', line 98

def top
  @top
end

Class Method Details

.fit_keywordObject



109
# File 'lib/pdfrb/destination/fit.rb', line 109

def fit_keyword; :FitR; end

Instance Method Details

#to_pdfObject



112
113
114
# File 'lib/pdfrb/destination/fit.rb', line 112

def to_pdf
  Pdfrb::Model::PdfArray.new([@page_ref, :FitR, @left, @bottom, @right, @top])
end