Class: PDF::Wrapper::TextImageCell

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/wrapper/text_image_cell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, filename, width, height) ⇒ TextImageCell

Returns a new instance of TextImageCell.



11
12
13
14
15
16
17
18
19
# File 'lib/pdf/wrapper/text_image_cell.rb', line 11

def initialize(str, filename, width, height)
  @text = str.to_s
  @filename = filename
  @min_width = width
  @natural_width = width
  @max_width = width
  @height = height
  @options = {}
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



8
9
10
# File 'lib/pdf/wrapper/text_image_cell.rb', line 8

def height
  @height
end

#max_widthObject (readonly)

Returns the value of attribute max_width.



7
8
9
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7

def max_width
  @max_width
end

#min_widthObject (readonly)

Returns the value of attribute min_width.



7
8
9
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7

def min_width
  @min_width
end

#natural_widthObject (readonly)

Returns the value of attribute natural_width.



7
8
9
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7

def natural_width
  @natural_width
end

#optionsObject



36
37
38
# File 'lib/pdf/wrapper/text_image_cell.rb', line 36

def options
  @options ||= {}
end

#textObject (readonly)

Returns the value of attribute text.



7
8
9
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7

def text
  @text
end

#widthObject

Returns the value of attribute width.



8
9
10
# File 'lib/pdf/wrapper/text_image_cell.rb', line 8

def width
  @width
end

#wrapperObject (readonly)

Returns the value of attribute wrapper.



7
8
9
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7

def wrapper
  @wrapper
end

Instance Method Details

#calculate_height(wrapper) ⇒ Object



32
33
34
# File 'lib/pdf/wrapper/text_image_cell.rb', line 32

def calculate_height(wrapper)
  # nothing required, height set in constructor
end

#calculate_width_range(wrapper) ⇒ Object



28
29
30
# File 'lib/pdf/wrapper/text_image_cell.rb', line 28

def calculate_width_range(wrapper)
  # nothing required, width range set in constructor
end

#draw(wrapper, x, y) ⇒ Object



21
22
23
24
25
26
# File 'lib/pdf/wrapper/text_image_cell.rb', line 21

def draw(wrapper, x, y)
  @wrapper = wrapper

  wrapper.cell(self.text, x, y, self.width, self.height, self.options)
  wrapper.image(@filename, image_options(x,y))
end