Laying Out the Listings 

sub add_pdf_listings {
  my($pdf, $data) = @_;

  $pdf->setSize(10.0);
  $pdf->setFont('Helvetica');
  $pdf->addRawText(' ', 20, 20);  # Ignore this line

  my $lines = int(($otm - $obm) / $olh + 0.5);
  my $count = @$data;

  foreach my $i (0..$count-1) {
    my $col = int($i / $lines);
    my $row = $i % $lines;

    add_pdf_entry($pdf, $row, $col, $data->[$i]);
  }
}