Class Origami::XRef
In: sources/parser/xreftable.rb
Parent: Object

Class representing a Cross-reference information.

Methods

new   to_s   to_xrefstm_data  

Classes and Modules

Class Origami::XRef::Section
Class Origami::XRef::Subsection

Constants

FREE = "f"
USED = "n"
LASTFREE = 65535

Attributes

generation  [RW] 
offset  [RW] 
state  [RW] 

Public Class methods

Creates a new XRef.

offset:The file offset of the referenced Object.
generation:The generation number of the referenced Object.
state:The state of the referenced Object (FREE or USED).

[Source]

    # File sources/parser/xreftable.rb, line 46
46:     def initialize(offset, generation, state)
47:     
48:       @offset, @generation, @state = offset, generation, state
49:     
50:     end

Public Instance methods

Outputs self into PDF code.

[Source]

    # File sources/parser/xreftable.rb, line 68
68:     def to_s
69:       off = ("0" * (10 - @offset.to_s.length)) + @offset.to_s
70:       gen = ("0" * (5 - @generation.to_s.length)) + @generation.to_s
71:       
72:       "#{off} #{gen} #{@state}" + EOL
73:     end

[Source]

    # File sources/parser/xreftable.rb, line 75
75:     def to_xrefstm_data
76:       type = (@state == FREE) ? 0 : 1
77: 
78:       [ type, @offset, @generation ].pack("Cnn")
79:     end

[Validate]