class PDF::Writer::Object::Action
An action object, used to link to URLS initially
Attributes
label[RW]
type[RW]
Public Class Methods
new(parent, label, type = "URI")
click to toggle source
Calls superclass method
PDF::Writer::Object::new
# File lib/pdf/writer/object/action.rb 13 def initialize(parent, label, type = "URI") 14 super(parent) 15 16 @type = type 17 @label = label 18 raise TypeError if @label.nil? 19 end
Public Instance Methods
to_s()
click to toggle source
# File lib/pdf/writer/object/action.rb 24 def to_s 25 res = "\n#{@oid} 0 obj\n<< /Type /Action" 26 if @type == :ilink 27 res << "\n/S /GoTo\n/D #{@parent.destinations[@label].oid} 0 R" 28 elsif @type == 'URI' 29 res << "\n/S /URI\n/URI (" 30 res << PDF::Writer.escape(@parent.arc4.encrypt(@label)) 31 res << ")\n" 32 end 33 res << ">>\nendobj" 34 end