ezPDF Question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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:


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.

Re: ezPDF Question

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.


Re: ezPDF Question

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


Re: ezPDF Question

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.


Re: ezPDF Question

In a contingent reality, Thomas Mlynarczyk possibly said:

Quoted text here. Click to load it

The margins were the magic bullet. Didn't have to hack anything, or  
rewrite my functions to count lines, etc.

Thanks for the help.

Site Timeline