Class: Rpdf2txt::PageNode
- Defined in:
- lib/rpdf2txt/object.rb
Instance Attribute Summary collapse
-
#kids ⇒ Object
readonly
Returns the value of attribute kids.
Attributes inherited from TreeNode
Attributes inherited from PdfObject
#attributes, #decoder, #oid, #src
Instance Method Summary collapse
Methods inherited from TreeNode
Methods inherited from PdfObject
#_parse_attributes, #catalogue_object, #decoded_stream, #extract_attribute_stream, #initialize, #parse_attributes, #revision_id
Constructor Details
This class inherits a constructor from Rpdf2txt::PdfObject
Instance Attribute Details
#kids ⇒ Object (readonly)
Returns the value of attribute kids.
482 483 484 |
# File 'lib/rpdf2txt/object.rb', line 482 def kids @kids end |
Instance Method Details
#build_tree(object_catalogue, parent = nil) ⇒ Object
483 484 485 486 487 488 489 490 491 |
# File 'lib/rpdf2txt/object.rb', line 483 def build_tree(object_catalogue, parent=nil) @kids = [] extract_oids(@attributes[:kids]).each { |id| child = object_catalogue[id] @kids.push(child) child.build_tree(object_catalogue, self) } super end |
#each ⇒ Object
492 493 494 495 496 |
# File 'lib/rpdf2txt/object.rb', line 492 def each @kids.each { |kid| kid.each { |result| yield result } } end |
#media_box ⇒ Object
497 498 499 500 501 |
# File 'lib/rpdf2txt/object.rb', line 497 def media_box if(mb = @attributes[:mediabox]) mb.collect { |val| val.to_f } end end |