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(doc) ⇒ Revision

Returns a new instance of Revision.



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

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



83
84
85
# File 'lib/origami/pdf.rb', line 83

def body
  @body
end

#pdfObject

Returns the value of attribute pdf.



82
83
84
# File 'lib/origami/pdf.rb', line 82

def pdf
  @pdf
end

#trailerObject

Returns the value of attribute trailer.



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

def trailer
  @trailer
end

#xrefstmObject

Returns the value of attribute xrefstm.



83
84
85
# File 'lib/origami/pdf.rb', line 83

def xrefstm
  @xrefstm
end

#xreftableObject

Returns the value of attribute xreftable.



83
84
85
# File 'lib/origami/pdf.rb', line 83

def xreftable
  @xreftable
end

Instance Method Details

#each_object(&b) ⇒ Object



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

def each_object(&b)
    @body.each_value(&b)
end

#has_xrefstm?Boolean

Returns:



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

def has_xrefstm?
    not @xrefstm.nil?
end

#has_xreftable?Boolean

Returns:



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

def has_xreftable?
    not @xreftable.nil?
end

#objectsObject



112
113
114
# File 'lib/origami/pdf.rb', line 112

def objects
    @body.values
end