Class: RPDF::PageTree
- Inherits:
-
PDFDictionary
- Object
- PDFObject
- PDFDictionary
- RPDF::PageTree
- Defined in:
- lib/rpdf/pagetree.rb
Overview
Page Tree Object
- PDFRef15 p116
Instance Attribute Summary
Attributes inherited from PDFDictionary
Attributes inherited from PDFObject
#generation_number, #object_number
Instance Method Summary collapse
- #add_page(page) ⇒ Object
-
#initialize(document, parent = nil) ⇒ PageTree
constructor
A new instance of PageTree.
Methods inherited from PDFDictionary
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 |