Class: EideticPDF::PdfObjects::PdfFile

Inherits:
Object
  • Object
show all
Defined in:
lib/epdfo.rb

Overview

root of object tree representing a PDF document

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePdfFile

Returns a new instance of PdfFile.



862
863
864
865
866
# File 'lib/epdfo.rb', line 862

def initialize
  @header = Header.new
  @body = Body.new
  @trailer = Trailer.new
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



860
861
862
# File 'lib/epdfo.rb', line 860

def body
  @body
end

#headerObject (readonly)

Returns the value of attribute header.



860
861
862
# File 'lib/epdfo.rb', line 860

def header
  @header
end

#trailerObject (readonly)

Returns the value of attribute trailer.



860
861
862
# File 'lib/epdfo.rb', line 860

def trailer
  @trailer
end

Instance Method Details

#to_sObject



868
869
870
871
872
873
874
875
876
877
878
879
# File 'lib/epdfo.rb', line 868

def to_s
  xref_table = XRefTable.new
  xref_sub_section = XRefSubSection.new
  xref_table << xref_sub_section

  s = @header.to_s
  @body.write_and_xref(s, xref_sub_section)
  @trailer.xref_table_start = s.length
  @trailer.xref_table_size = xref_sub_section.size
  s << xref_table.to_s
  s << @trailer.to_s
end