<commit_before>
require 'podoff'

d = Podoff.load('tmp/uig.pdf')

p1 = d.page(1)

fo = d.add_base_font('Helvetica')

st =
  d.add_stream(%{
    BT
      100 650 Td /Helvetica 35 Tf
      (Hello World Again!) Tj
    ET
    BT
      300 750 Td /Helvetica 35 Tf
      (Stuff NADA) Tj
    ET
  }.strip)

p1 = p1.insert_content(st)
p1.add_to_fonts('Helvetica', fo.ref)

d.write('tmp/out.pdf')
<commit_msg>draft api for document.add* / obj.insert*<commit_after>
require 'podoff'

d = Podoff.load('tmp/uig.pdf')

p1 = d.page(1)

  # additions
  #
#o = document.add_base_font(x)
#o = document.add_stream(x)
#o = document.re_add(o0) # replicate

  # object tweaking
  #
#obj.insert_content(o / o.ref)
#obj.insert_font(nick, o / o.ref)

fo = d.add_base_font('Helvetica')

st =
  d.add_stream(%{
    BT
      100 650 Td /Helvetica 35 Tf
      (Hello World Again!) Tj
    ET
    BT
      300 750 Td /Helvetica 35 Tf
      (Stuff NADA) Tj
    ET
  }.strip)

  # idea
  #
#st = d.add_stream {
#  tf '/Helvetica', 35
#  bt 100, 650, 'Hello World Again!'
#  bt 300, 750, 'Stuff NADA',
#}

p1 = p1.insert_content(st)
p1.add_to_fonts('Helvetica', fo.ref)

d.write('tmp/out.pdf')

{'fraction_non_alphanumeric': 0.1507321274763135, 'fraction_numerical': 0.04909560723514212, 'mean_word_length': 2.772727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '690608', 'n_tokens_mistral': 564, 'n_tokens_neox': 509, 'n_words': 116}