Class representing a Cross-reference information.
Outputs self into PDF code.
# File lib/origami/xreftable.rb, line 102 def to_s off = ("0" * (10 - @offset.to_s.length)) + @offset.to_s gen = ("0" * (5 - @generation.to_s.length)) + @generation.to_s "#{off} #{gen} #{@state}" + EOL end
# File lib/origami/xreftable.rb, line 109 def to_xrefstm_data(type_w, field1_w, field2_w) type_w <<= 3 field1_w <<= 3 field2_w <<= 3 type = ((@state == FREE) ? "\0000" : "\0001").unpack("B#{type_w}")[0] offset = @offset.to_s(2) offset = '0' * (field1_w - offset.size) + offset generation = @generation.to_s(2) generation = '0' * (field2_w - generation.size) + generation [ type , offset, generation ].pack("B#{type_w}B#{field1_w}B#{field2_w}") end
Generated with the Darkfish Rdoc Generator 2.