Marco wrote:
I insert number of page in a file pdf with the following lines:
//...
writer=PdfWriter.getInstance(document,new FileOutputStream(nomefile));
HeaderFooter header=new HeaderFooter(new Phrase("~ "),new Phrase("
~"));
header.setAlignment(header.ALIGN_CENTER);
header.setBorder(com.lowagie.text.Rectangle.BOTTOM);
document.setHeader(header);
document.open();
//...
Only, with Rectangle.BOTTOM the line that was inserted is too long; i want
only a line under "~ 1 ~".
How it is possible?
I haven't tested this, but using a Font with style UNDERLINED for the
~-phrase may solve your problem. Or adding a Chunk with a GenericTag to
the Phrases, one with message 'start' and one with message 'end'. When
the start-event is triggered, store the left() en bottom() value of the
Rectangle; when the end-event is triggered, draw a line from the stored
coordinate to the right() en bottom() value.
But of course, the best way, is not to use the HeaderFooter object, but
an onEndPage-event:
http://itextdocs.lowagie.com/tutorial/directcontent/pageevents/index.html#examples
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions