David Ge wrote:
> Hi: > > I need to create a pdf file, with layout like [header | table of data > (read from database) | footer]. The number of the rows of the table is > not fixed, can across multiple pages. > Ideally, like to import a template pdf file of layout [ header | xx | > footer], then fill in/replace the 'xx' with actual data from database. > Or, can I import header.pdf (into what object), add content to > document, and then append footer.pdf? > Is this achievable using iText? Form fill seems to require fixed > number of rows.
First write your code with PdfPTable as if you don't need a header/footer. [#1]
Then write a subclass for PdfPageEventsHelper [#2]. Make sure to load the imported page on onStartDocument and add this imported page in onEndPage. Now add an extra line to [#1] where you declare [#2] to the PdfWriter. br, Bruno ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
