File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add footer using iText version 5

 
maynard keenan
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've updated the http://faq.javaranch.com/java/ItextExample example for iText 5; it demonstrates headers and footers, amongst other things.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic