Use page events, HeaderFooter is not supported anymore.
Paulo
> -----Original Message-----
> From: Deepa Thakur [mailto:deepathakur...@gmail.com]
> Sent: Tuesday, May 19, 2009 12:49 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Headers are not getting added
> properly in itext document.
>
> Hi,
> I am generating pdf in java using itext. I want to display
> the different
> headers on different pages. I'm using one single document and
> pages are
> getting added to it at run time. I have got 5 servlets
> written to generate
> the whole pdf. At start of every servlet i've written the
> code for header
> the problem is when its get generated the header gets added
> to the one more
> extra page.
> to get clear idea i am including the eg below.
> Eg 1-3 pages i want header1 to get display.
> 4-7 pages I want header2 to get display.
> 8-10 Pages I want header3 to get display
> The actual output which i get is as follows.
> 2-4 header1
> 5-8 header2
> 9-10 header3
>
> Even I used the page event method onStartPage for this, but
> same problem continues.
> Below is the code which i'm adding at start of each servlet.
>
> HeaderFooter header = new HeaderFooter(
> new Phrase("ABC",
> headfont), false);
> header.setBorder(Rectangle.NO_BORDER);
> header.setAlignment(Element.ALIGN_CENTER);
> document.setHeader(header);
>
> Please help me to resolve this issue.
> Thanks.
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/