I've used the following code to display header and footer in my pdf using itext.
HeaderFooter header=new HeaderFooter(new Phrase("HBOM Reports"),false);
document.setHeader(header);
HeaderFooter footer=new HeaderFooter(new Phrase("globematics\nSecond line"),false);
document.setFooter(footer);
Here is my header displayed output in my pdf
HBOM Reports
My footer displayed as like this
globematics
second line
Now I don’t know why the two lines are printing on my header and footer.
-
I want to remove the bottom line from my footer and top line from my
header. And I need to align both header and footer text in Center.Just now I started using iText so I don’t have any idea in that.Please some help me for this.
Thanks in advance
You can use
setAlignementto center the text, andsetBorderto remove the border and add only the one you want.As I have seen multiple times on the web, the use of this class is discouraged, you may take a look at page events