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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|