This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Tina Tibrewal wrote:Adding Multiple line header and footer doesnt seem possible with PdfStamper.
That's not correct.
There are different ways to add a multiple line header.
Please read chapter 3 of the book to find out how to use ColumnText to add multiple lines at absolute positions.
You can also use a PdfPTable.
As a matter of fact, there's an example in the chapter that is available for free on the book page at Manning
that uses a PdfPTable for the header; see listing 6.14. As you probably know a PdfPCell can consist of multiple lines.
Joined: Apr 19, 2007
I got it working. But now the problem I am facing is - It is not writing the header properly. Though I do a getOverContent and getUnderContent and then add tables but somehow the header is not being written. Any suggestions there?
My code looks like -
Joined: Oct 23, 2006
Tina Tibrewal wrote:I got it working.
The book sample works.
Tina Tibrewal wrote:But now the problem I am facing is - It is not writing the header properly.
You adapted the book sample, and you don't see the header, but I'm not sitting at your desk, I can't see what's wrong.
I can only tell that 1000pt seems like a very large table to me (does it fit on the page, or is it written outside the visible area of the page?) and that I really don't like these lines:
Tina Tibrewal wrote:Document document = underContent.getPdfDocument();
Document overDocument = overContent.getPdfDocument();
You didn't get these from one of the book examples, did you?