This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Add footer using iText version 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Add footer using iText version 5" Watch "Add footer using iText version 5" New topic
Author

Add footer using iText version 5

maynard keenan
Greenhorn

Joined: Feb 11, 2010
Posts: 1
Hi,

I am trying to replace my old code for adding footer to a page to make it compatible with the new version(5.0.1), which does not support HeaderFooter class anymore. My existing code looks like this:

HeaderFooter footer = new HeaderFooter(new Phrase("page: "), true);
footer.setBorder(Rectangle.NO_BORDER);
footer.setAlignment(2);
document.setFooter(footer);

I am new to iText and not aware of the new(ver 5) way of doing this. Please advise. Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43
Huh, they seem to have removed the introduction and example codes that used to be available on the iText site. I guess that means they *really* want folks to buy the book; not a particularly nice move (I very much liked the first edition of the book, though, it was worthwhile having for anyone using iText seriously). Nonetheless, they'll lose users over this.

Out of curiosity, why do you want to upgrade? Can iText 5 do things that iText 2 can't?


Ping & DNS - my free Android networking tools app
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43
I've updated the http://faq.javaranch.com/java/ItextExample example for iText 5; it demonstrates headers and footers, amongst other things.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43
Also note that, according to iText's main developer, iText 5 is not yet stable, and the API might change well into the summer of this year. In other words, the time to make the switch has not yet come.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Add footer using iText version 5
 
Similar Threads
How to add image in the footer of PDF
Adding Header and Footer to an existing PDF
footer in itext how
How do I get A Footer on the First Page of a PDF Document
Headers and Footers are not appearing in saved PDF