Class: Origami::PDF::Revision

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

Overview

Class representing a particular revision in a PDF file. Revision contains :

  • A Body, which is a sequence of Object.

  • A XRef::Section, holding XRef information about objects in body.

  • A Trailer.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf) ⇒ Revision

Returns a new instance of Revision.



88
89
90
91
92
93
94
# File 'lib/origami/pdf.rb', line 88

def initialize(pdf)
  @pdf = pdf
  @body = {}
  @xreftable = nil
  @xrefstm = nil
  @trailer = nil
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



86
87
88
# File 'lib/origami/pdf.rb', line 86

def body
  @body
end

#pdfObject

Returns the value of attribute pdf.



85
86
87
# File 'lib/origami/pdf.rb', line 85

def pdf
  @pdf
end

#trailerObject

Returns the value of attribute trailer.



86
87
88
# File 'lib/origami/pdf.rb', line 86

def trailer
  @trailer
end

#xrefstmObject

Returns the value of attribute xrefstm.



86
87
88
# File 'lib/origami/pdf.rb', line 86

def xrefstm
  @xrefstm
end

#xreftableObject

Returns the value of attribute xreftable.



86
87
88
# File 'lib/origami/pdf.rb', line 86

def xreftable
  @xreftable
end

Instance Method Details

#has_xrefstm?Boolean

Returns:



105
106
107
# File 'lib/origami/pdf.rb', line 105

def has_xrefstm?
  not @xrefstm.nil?
end

#has_xreftable?Boolean

Returns:



101
102
103
# File 'lib/origami/pdf.rb', line 101

def has_xreftable?
  not @xreftable.nil?
end

#objectsObject



109
110
111
# File 'lib/origami/pdf.rb', line 109

def objects
  @body.values
end