Class: RPDF::PageTree

Inherits:
PDFDictionary show all
Defined in:
lib/rpdf/pagetree.rb

Overview

Page Tree Object

PDFRef15 p116

Instance Attribute Summary

Attributes inherited from PDFDictionary

#dict

Attributes inherited from PDFObject

#generation_number, #object_number

Instance Method Summary collapse

Methods inherited from PDFDictionary

#[], #[]=, #to_s, #update

Methods inherited from PDFObject

#indirect?, #invalidate, #invalidated?, #to_pdf, #to_ref

Constructor Details

#initialize(document, parent = nil) ⇒ PageTree

Returns a new instance of PageTree.



9
10
11
12
13
14
15
# File 'lib/rpdf/pagetree.rb', line 9

def initialize(document, parent=nil)
  super({ :Type => :Pages,
          :Parent => parent,
          :Kids => [],
          :Count => 0 }, 
        document)
end

Instance Method Details

#add_page(page) ⇒ Object



17
18
19
20
# File 'lib/rpdf/pagetree.rb', line 17

def add_page(page)
  self[:Kids] << page
  self[:Count] = self[:Count].value + 1
end