C Sell wrote:

Here is code that is producing the header
public void onStartPage(PdfWriter writer, Document document) {
Font headerFont = FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD); try {
            Table table = new Table(3,1);

I know the documentation isn't always very clear,
but you have broken a few 'unwritten' rules ;-)
Here they come:
1. Do not use class Table; use class PdfPTable instead.
 reason: class Table isn't supported anymore
 and class PdfPTable gives you more control over what happens.
2. Do not use document.add() in a page event, use writeSelectedRows.
 reason: the document object passed to onStartPage should
 be considered to be read-only (it's a PdfDocument object,
 not a Document object). If you use document.add(), the layout
 risks to be completely wrong.
Note that I am working on the documentation, but it takes
a lot of time...
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

Reply via email to