By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,630 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,630 IT Pros & Developers. It's quick & easy.

ezPDF Question

P: n/a

This may or may not be the correct place to discuss my question; if not,
please direct me.

I am using the ezPDF library to dump the contents of a table into a PDF
with the function:

$pdf->ezTable(array_of_values);

The problem is that if the array is too large, it bleeds onto the next
page. This would be fine, but I created custom headers and footers that
appear on each page, but sometimes are covered up by the table, if that
makes any sense. The question, then, is whether or not it is posible to
automatically set the table to paginate upon reaching a certain size
(thereby not covering up the header and footer) or if I must determine the
size myself and create multiple tables.

Thanks for any help.
Nov 30 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You could "hack" the function ezNewPage() (search in the source code) by
adding at the end a call to a function defined by yourself where you a) draw
the header/footer of the page and b) set the page's margins and vertical
start position as required (ezSetCmMargins(), ezSetY()). I've done this and
it works in general, but I haven't tested this with tables.

Greetings,
Thomas
Nov 30 '06 #2

P: n/a
If you know how many records will fit on the page, you could break the
array into say 25 lines and then dump each array out through the ezPDF
function with the headers and footers.

You should be able to find lots of examples of pagination for
displaying data sets in html tables and you are only looking at the
same process but a different output destination.

If you don't know how many lines you can fit on the page (e.g. you may
have cells with word wrap in them) then you will need to do something a
bit more clever and built the array one line at a time and estimate how
far down the page you are

Obiron

Dec 1 '06 #3

P: n/a
Having read your post again, here's another thought of mine:

You can set margins for your pages which should be respected by the table
generating function. You should set these margins so that your header and
footer fit within the margins and are therefore outside the main canvas
area. There are functions in the base class like addText() which allow you
to write outside the margins.

Greetings,
Thomas
Dec 1 '06 #4

P: n/a
In a contingent reality, Thomas Mlynarczyk possibly said:
Having read your post again, here's another thought of mine:

You can set margins for your pages which should be respected by the table
generating function. You should set these margins so that your header and
footer fit within the margins and are therefore outside the main canvas
area. There are functions in the base class like addText() which allow you
to write outside the margins.
The margins were the magic bullet. Didn't have to hack anything, or
rewrite my functions to count lines, etc.

Thanks for the help.
Dec 1 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.