| Class | PDF::Writer::Object::Action |
| In: |
lib/pdf/writer/object/action.rb
|
| Parent: | PDF::Writer::Object |
| label | [RW] | |
| type | [RW] |
# File lib/pdf/writer/object/action.rb, line 13
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
# File lib/pdf/writer/object/action.rb, line 24
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(@label)
31: res << ")\n"
32: end
33: res << ">>\nendobj"
34: end