class PDF::Writer::Object::Outline

Define the outlines in the doc, empty for now

Public Class Methods

new(parent, label, title = label) click to toggle source
Calls superclass method PDF::Writer::Object::new
   # File lib/pdf/writer/object/outline.rb
13 def initialize(parent, label, title = label)
14   super(parent)
15 
16   @action = PDF::Writer::Action.new(parent, label, :ilink)
17   @title  = title
18 
19   parent.outlines.list << self
20 end

Public Instance Methods

to_s() click to toggle source
   # File lib/pdf/writer/object/outline.rb
22 def to_s
23   pos = @parent.outlines.list.index(self)
24   res = "\n#{@oid} 0 obj\n<< /Title (#{@title})"
25   res << " /Prev #{@parent.outlines.list[pos - 1].oid} 0 R" if pos.nonzero?
26   res << " /Next #{@parent.outlines.list[pos + 1].oid} 0 R" if @oid != parent.outlines.list[-1].oid
27   res << " /A #{@action.oid} 0 R>>\nendobj"
28   res
29 end