It appears that every generic object is being deprecated.  The files I am
working with are sometimes printing to PDF, sometimes to RTF.  I am under
the impression that page events are only for PDF files.  Is the new idea
going to be to code everything completely separately for PDF and RTF files? 
Why is it not a good idea to keep supporting things like Table, Cell,
HeaderFooter, etc. that work for both PDF and RTF, just depending on what
kind of writer you call?


mister bean wrote:
> 
> Your solution will work until you attempt another modification.
> HeaderFooter has been retired and is now deprecated. Use page events
> instead. The book and the online docs have examples.
> 
> ---mr. bean
> 
>>>> re >>>
> 
> 
> tamtam18 wrote:
>> 
>> I figured out the problem  Using a Phrase to create the HeaderFooter
>> (instead of a Paragraph object) solved the problem.  
>> 
>> Change this line:
>> 
>>     HeaderFooter header = new HeaderFooter(new Paragraph(headString,
>> iTextHeadingFont), true);
>> 
>> To this:
>> 
>>     HeaderFooter header = new HeaderFooter(new Phrase(headString,
>> iTextHeadingFont), true);
>> 
>> 
>> 
>> tamtam18 wrote:
>>> 
>>> 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? 
>>> 
>>> Sample Code:
>>>     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
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/HeaderFooter---page-number-printing-on-next-line-tp24185404p24196168.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to