header - iText HeaderFooter -- page number appearing on the next line -
I am creating a header with iText using the headerfooter object. The page number is always displayed on the second row of the header, even if there are so many rooms on the first line, and I'm not clearly putting a line break there. It seems that this problem only started during the upgrade of iText 2.1.5 from iText 1.2, but I did not clear anything in the iText source code. Does anyone else have this problem, or knows how to solve it?
headstring + = viewReportTitle + "Page:"; // Set the second paragraph to the right HeaderFooter header = new HeaderFooter (new paragraph (headstrings, iTextHeadingFont, true); Header.setAlignment (Element.ALIGN_CENTER); ITextDoc.setHeader (header);
The output looks like this:
report title page: 1
I understand all those who are interested. The problem is resolved by changing the headerfooter parameter from the phrase to the paragraph.
Change this line:
headerfuter header = new headerfutter (new paragraph (headstrings, iTextHeadingFont, true);
To do this:
headerfighter header = new headerfooter (new phrase (headstrings, iTextHeadingFont, true);
The problem is closed!
Comments
Post a Comment