class Origami::PDF::JavaScript::Field
Public Class Methods
new(engine, field)
click to toggle source
Calls superclass method
Origami::PDF::JavaScript::AcrobatObject.new
# File lib/origami/javascript.rb, line 470 def initialize(engine, field) super(engine) @field = field end
Public Instance Methods
doc()
click to toggle source
# File lib/origami/javascript.rb, line 476 def doc; Doc.new(@field.pdf) end
name()
click to toggle source
# File lib/origami/javascript.rb, line 477 def name (@field.T.value if @field.has_key?(:T)).to_s end
type()
click to toggle source
# File lib/origami/javascript.rb, line 489 def type (if @field.has_key?(:FT) case @field.FT.value when PDF::Field::Type::BUTTON if @fields.has_key?(:Ff) flags = @field.Ff.value if (flags & Origami::Annotation::Widget::Button::Flags::PUSHBUTTON) != 0 'button' elsif (flags & Origami::Annotation::Widget::Button::Flags::RADIO) != 0 'radiobox' else 'checkbox' end end when PDF::Field::Type::TEXT then 'text' when PDF::Field::Type::SIGNATURE then 'signature' when PDF::Field::Type::CHOICE if @field.has_key?(:Ff) if (@field.Ff.value & Origami::Annotation::Widget::Choice::Flags::COMBO).zero? 'listbox' else 'combobox' end end end end).to_s end
value()
click to toggle source
# File lib/origami/javascript.rb, line 481 def value @field.V.value if @field.has_key?(:V) end
valueAsString()
click to toggle source
# File lib/origami/javascript.rb, line 485 def valueAsString self.value.to_s end