Class: Pdfrb::Destination::XYZ

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

Overview

/XYZ left top zoom — explicit position and zoom.

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: nil, top: nil, zoom: nil) ⇒ XYZ

Returns a new instance of XYZ.



122
123
124
125
126
127
# File 'lib/pdfrb/destination/fit.rb', line 122

def initialize(page_ref, left: nil, top: nil, zoom: nil)
  super(page_ref)
  @left = left
  @top = top
  @zoom = zoom
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



120
121
122
# File 'lib/pdfrb/destination/fit.rb', line 120

def left
  @left
end

#topObject (readonly)

Returns the value of attribute top.



120
121
122
# File 'lib/pdfrb/destination/fit.rb', line 120

def top
  @top
end

#zoomObject (readonly)

Returns the value of attribute zoom.



120
121
122
# File 'lib/pdfrb/destination/fit.rb', line 120

def zoom
  @zoom
end

Class Method Details

.fit_keywordObject



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

def fit_keyword; :XYZ; end

Instance Method Details

#to_pdfObject



133
134
135
# File 'lib/pdfrb/destination/fit.rb', line 133

def to_pdf
  Pdfrb::Model::PdfArray.new([@page_ref, :XYZ, @left, @top, @zoom].compact)
end