Kuldeep Kataria wrote:

Thanks for reply,
Yes I mean page height. you are right, If it goes on
to other pages, but I need to print and header and
footer for all the pages. On the first page, I
overlaps on footer and after that it does not print
header and footer. Here is the code. Please share your
thoughts.


Please keep on the mailinglist if someone replies to your question.

Document.add() adds content on the current page at the current y position.
I don't understand why the method you have sent me uses document.add
to add a footer. How do you know you're at the end of a page???

Also: if you change margins, this only goes into effect on the next page.
It has no effect on the current page.

It seems to me you are mixing content (document.add) with things
that should go in a page event (PdfContentByte). But from your code
I can't be sure what you are trying to achieve.

Please read the tutorial chapters on PageEvents first:
http://www.lowagie.com/iText/tutorial/ch12.html

private void renderRemarkPage( Document doc, Map
longItems, float footerSize ) throws
Exception
{
doc.add( new Phrase( "\n" ) );
Phrase remarkTitle = new Phrase( "Remarks:",
FontFactory.getFont( FontFactory.
HELVETICA_BOLD,
14 ) );
doc.add( remarkTitle );
doc.add( new Phrase( "\n\n" ) );
doc.setMargins( marginLeftPort, marginRightPort,
marginTopPort,
footerSize );
Iterator remarkIter =
longItems.keySet().iterator();
while ( remarkIter.hasNext() )
{
Integer remIndex = ( Integer )
remarkIter.next();
DataItem item = ( DataItem ) longItems.get(
remIndex );
Chunk ck = new Chunk(
item.getValue().toString(), bodyValueFont );
Phrase phrase = new Phrase( remIndex + "." + "
Item \"" +
item.getPrompt() +
"\" value: ",
FontFactory.getFont(
FontFactory.
HELVETICA_BOLD,
10 ) );


phrase.add( ck );
doc.add( phrase );
doc.add( new Phrase( "\n" ) );
}
}





------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to