Class: Rpdf2txt::TrailerDictionary
- Defined in:
- lib/rpdf2txt/object.rb
Instance Attribute Summary
Attributes inherited from PdfObject
Instance Method Summary collapse
- #encrypt_id ⇒ Object
- #file_id ⇒ Object
-
#root_id ⇒ Object
def parse_attributes index = @src.index(‘trailer’) rindex = @src.rindex(‘startxref’) unless(index && rindex) @attibutes = {} else #set correct offsets <<(begin) >>(end) src = @src ast = Rpdf2txt.attributes_parser.parse(src) ast.compact! @attributes = extract_attributes(ast) end end.
- #update(trailer_dict) ⇒ Object
Methods inherited from PdfObject
#_parse_attributes, #build_tree, #catalogue_object, #decoded_stream, #extract_attribute_stream, #initialize, #parse_attributes, #revision_id
Constructor Details
This class inherits a constructor from Rpdf2txt::PdfObject
Instance Method Details
#encrypt_id ⇒ Object
417 418 419 |
# File 'lib/rpdf2txt/object.rb', line 417 def encrypt_id extract_oid(@attributes[:encrypt]) end |
#file_id ⇒ Object
414 415 416 |
# File 'lib/rpdf2txt/object.rb', line 414 def file_id /[a-zA-Z0-9]+/n.match(@attributes[:id].first).to_s end |
#root_id ⇒ Object
def parse_attributes index = @src.index(‘trailer’) rindex = @src.rindex(‘startxref’) unless(index && rindex) @attibutes = {} else #set correct offsets <<(begin) >>(end) src = @src ast = Rpdf2txt.attributes_parser.parse(src) ast.compact! @attributes = extract_attributes(ast) end end
435 436 437 |
# File 'lib/rpdf2txt/object.rb', line 435 def root_id extract_oid(@attributes[:root]) end |
#update(trailer_dict) ⇒ Object
438 439 440 |
# File 'lib/rpdf2txt/object.rb', line 438 def update(trailer_dict) @attributes.update(trailer_dict.attributes) end |