Class: Rpdf2txt::ReferenceArray

Inherits:
TreeNode show all
Defined in:
lib/rpdf2txt/object.rb

Instance Attribute Summary

Attributes inherited from TreeNode

#parent

Attributes inherited from PdfObject

#attributes, #decoder, #oid, #src

Instance Method Summary collapse

Methods inherited from TreeNode

#each, #extract_oids

Methods inherited from PdfObject

#_parse_attributes, #catalogue_object, #decoded_stream, #extract_attribute_stream, #initialize, #revision_id

Constructor Details

This class inherits a constructor from Rpdf2txt::PdfObject

Instance Method Details

#build_stream(concat_stream) ⇒ Object



1116
1117
1118
1119
1120
1121
# File 'lib/rpdf2txt/object.rb', line 1116

def build_stream(concat_stream)
  @contents.each { |stream|
    concat_stream.append(stream.decoded_stream)
  }
  concat_stream
end

#build_tree(object_catalogue, parent = nil) ⇒ Object



1109
1110
1111
1112
1113
1114
1115
# File 'lib/rpdf2txt/object.rb', line 1109

def build_tree(object_catalogue, parent=nil)
  @contents=[]
  @references.each{ |id|
    @contents.push(object_catalogue[id]) if object_catalogue[id]
  } 
  super
end

#parse_attributesObject



1122
1123
1124
1125
1126
1127
# File 'lib/rpdf2txt/object.rb', line 1122

def parse_attributes
  src = @src[@src.index('[')..@src.rindex(']')]
  ast = _parse_attributes(src)
  ast.compact!
  @references = extract_oids(extract_attributes(ast))
end

#root?Boolean

Returns:

  • (Boolean)


1128
1129
1130
# File 'lib/rpdf2txt/object.rb', line 1128

def root?
  false
end