Class: EideticPDF::PdfObjects::PdfPages

Inherits:
PdfPageBase show all
Defined in:
lib/epdfo.rb

Overview

collection of pages

Instance Attribute Summary collapse

Attributes inherited from IndirectObject

#gen, #seq

Instance Method Summary collapse

Methods inherited from PdfPageBase

#additional_actions=, #crop_box=, #duration=, #hidden=, #media_box=, #resources=, #rotate=, #transition=

Methods inherited from PdfDictionaryObject

#body, #dictionary

Methods inherited from IndirectObject

#body, #footer, #header, #reference_object, #reference_string

Constructor Details

#initialize(seq, gen, parent = nil) ⇒ PdfPages

Returns a new instance of PdfPages.



802
803
804
805
806
# File 'lib/epdfo.rb', line 802

def initialize(seq, gen, parent=nil)
  super(seq, gen, parent)
  @kids = []
  dictionary['Type'] = PdfName.new('Pages')
end

Instance Attribute Details

#kidsObject (readonly)

array of refs to PdfPageBase



800
801
802
# File 'lib/epdfo.rb', line 800

def kids
  @kids
end

Instance Method Details

#to_sObject



808
809
810
811
812
# File 'lib/epdfo.rb', line 808

def to_s
  dictionary['Count'] = PdfInteger.new(@kids.size)
  dictionary['Kids'] = PdfArray.new(@kids.map { |page| page.reference_object })
  super
end