Class: HexaPDF::XRefSection::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/hexapdf/xref_section.rb

Overview

One entry of a cross-reference section or stream.

An entry has the attributes type, oid, gen, pos and objstm and can be created like this:

Entry.new(type, oid, gen, pos, objstm)   -> entry

The type attribute can be:

:free

Denotes a free entry.

:in_use

A used entry that resides in the body of the PDF file. The pos attribute defines the position in the file at which the object can be found.

:compressed

A used entry that resides in an object stream. The objstm attribute contains the reference to the object stream in which the object can be found and the pos attribute contains the index into the object stream.

Objects in an object stream always have a generation number of 0!

See: PDF1.7 s7.5.4, s7.5.8

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#genObject

Returns the value of attribute gen



70
71
72
# File 'lib/hexapdf/xref_section.rb', line 70

def gen
  @gen
end

#objstmObject

Returns the value of attribute objstm



70
71
72
# File 'lib/hexapdf/xref_section.rb', line 70

def objstm
  @objstm
end

#oidObject

Returns the value of attribute oid



70
71
72
# File 'lib/hexapdf/xref_section.rb', line 70

def oid
  @oid
end

#posObject

Returns the value of attribute pos



70
71
72
# File 'lib/hexapdf/xref_section.rb', line 70

def pos
  @pos
end

#typeObject

Returns the value of attribute type



70
71
72
# File 'lib/hexapdf/xref_section.rb', line 70

def type
  @type
end

Instance Method Details

#compressed?Boolean



79
80
81
# File 'lib/hexapdf/xref_section.rb', line 79

def compressed?
  type == :compressed
end

#free?Boolean



71
72
73
# File 'lib/hexapdf/xref_section.rb', line 71

def free?
  type == :free
end

#in_use?Boolean



75
76
77
# File 'lib/hexapdf/xref_section.rb', line 75

def in_use?
  type == :in_use
end