tweetiepooh:

It looks like PDF::Table should be able to do the job. It automatically adds pages to your PDF document as it needs to. When you generate the table, it returns the reference to the last page it created, the vertical position of the end of the table (y) on the last page, and the number of pages it added. So you should be able to continue generating your document, something like:

# all the setup stuff for PDF and PDF table for my $table (@tables) { # Implementation left as an exercise to the reader ;^) $data = make_table_data($table); # Generate the table my ($last_pg, $pg_cnt, $y) = $pdfTblGen->table($PDF, $cur_pg, $data +, %settings); if ($y < FOO) { # Not enough space on the page for the next thing, so create a n +ew page . . . } else { # Still plenty of space ... add stuff to page at $y + some whitespace ... } }

The documentation is a bit skimpy, but there are a couple examples in the distribution you can play with. I installed it a few minutes ago, looks legit.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re: Creating a PDF with multiple tables and where data items can spread multipage by roboticus
in thread Creating a PDF with multiple tables and where data items can spread multipage by tweetiepooh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.