Class: DynamicPDFApi::TextBarcodeElement

Inherits:
BarcodeElement show all
Defined in:
lib/ruby_client/Elements/TextBarcodeElement.rb

Overview

Base class from which barcode page elements that display text are derived.

Instance Attribute Summary collapse

Attributes inherited from BarcodeElement

#_color_name, #value, #x_dimension

Attributes inherited from Element

#_input_value, #_type, #even_pages, #odd_pages, #placement, #x_offset, #y_offset

Instance Method Summary collapse

Methods inherited from BarcodeElement

#color=

Constructor Details

#initialize(value, placement, x_offset, y_offset) ⇒ TextBarcodeElement

Returns a new instance of TextBarcodeElement.



8
9
10
11
12
13
14
15
16
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 8

def initialize(value, placement, x_offset, y_offset)
  @text_color = nil
  @font_size = nil
  @show_text = nil
  @_resource = nil
  @_text_font = nil
  @_font_name = nil
  super(value, placement, x_offset, y_offset)
end

Instance Attribute Details

#_font_nameObject

Returns the value of attribute _font_name.



33
34
35
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 33

def _font_name
  @_font_name
end

#_resourceObject

Returns the value of attribute _resource.



33
34
35
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 33

def _resource
  @_resource
end

#_text_fontObject

Returns the value of attribute _text_font.



33
34
35
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 33

def _text_font
  @_text_font
end

#font_sizeObject

Gets or sets the font size to use when displaying the text.



26
27
28
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 26

def font_size
  @font_size
end

#show_textObject

Gets or sets a value indicating if the value should be placed as text below the barcode.



31
32
33
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 31

def show_text
  @show_text
end

#text_colorObject

Gets or sets the color of the text.



21
22
23
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 21

def text_color
  @text_color
end

Instance Method Details

#font(value) ⇒ Object

Gets or sets the font to use when displaying the text.



38
39
40
41
42
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 38

def font(value)
  @_text_font = value
  @_font_name = @_text_font._name
  @_resource = @_text_font._resource
end

#get_fontObject



44
45
46
# File 'lib/ruby_client/Elements/TextBarcodeElement.rb', line 44

def get_font
  @_text_font
end