Class: Wizport::Pdf::XRefTbl

Inherits:
Object
  • Object
show all
Defined in:
lib/wizport/document/pdf/x_ref_tbl.rb

Instance Method Summary collapse

Constructor Details

#initialize(count) ⇒ XRefTbl

Returns a new instance of XRefTbl.



9
10
11
12
# File 'lib/wizport/document/pdf/x_ref_tbl.rb', line 9

def initialize(count)
  @tbl = StringIO.new
  @tbl << "xref\n0 #{count}\n0000000000 65535 f \n";
end

Instance Method Details

#add(pos, ver = '00000', used = 'n') ⇒ Object



14
15
16
# File 'lib/wizport/document/pdf/x_ref_tbl.rb', line 14

def add(pos, ver = '00000', used = 'n')
  @tbl.printf "%010d #{ver} #{used} \n", pos
end

#to_sObject



18
19
20
# File 'lib/wizport/document/pdf/x_ref_tbl.rb', line 18

def to_s
  @tbl.string
end