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

Returns:

  • (Object)

    the current value of gen



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

def gen
  @gen
end

#objstmObject

Returns the value of attribute objstm

Returns:

  • (Object)

    the current value of objstm



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

def objstm
  @objstm
end

#oidObject

Returns the value of attribute oid

Returns:

  • (Object)

    the current value of oid



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

def oid
  @oid
end

#posObject

Returns the value of attribute pos

Returns:

  • (Object)

    the current value of pos



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

def pos
  @pos
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



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

def type
  @type
end

Instance Method Details

#compressed?Boolean

Returns:

  • (Boolean)


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

def compressed?
  type == :compressed
end

#free?Boolean

Returns:

  • (Boolean)


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

def free?
  type == :free
end

#in_use?Boolean

Returns:

  • (Boolean)


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

def in_use?
  type == :in_use
end