I am creating a header with iText using the HeaderFooter object. The Page Number is always appearing on the second line of the header, even though there is plenty of room on the first line, and I am not explicitly putting a line break there. It seems that this problem only started when upgrading from iText 1.2 to iText 2.1.5, but I didn't notice anything obvious in the iText source code. Has anyone else had this issue, or knows how to solve it?
headString += viewReportTitle + "Page: ";
//Setting the second param to true should append a page number at the end of the string
HeaderFooter header = new HeaderFooter(new Paragraph(headString, iTextHeadingFont), true);
header.setAlignment(Element.ALIGN_CENTER);
iTextDoc.setHeader(header);
The output appears like this:
Report Title Page:
1