Hi all

I have a generated document where I like to have a table of contents
with page links.
This works fine when i generate the toc as last page and then reorder
the pages, shifting the last page (toc) to the second (page after
title page).

Right after creating the document and getting the writer instance i
set the page Event

writer.setPageEvent(new MyHeaderFooter(<various unrelated params>);

In the MyHeaderFooter class I override the onEndPage method.

public void onEndPage(final PdfWriter writer, final Document document) {
  // code to print header and footer
  if(printPageNumber) {
      // I print out the page number here
  }
}

In the printed document i see the page numbers as following:

1
[number of last page]
3
4
[and so on to last page]

I would like now to change the [number of last page] to 2, so I can
print it. I helped myself with just not printing the page number on
the page by setting a member variable in MyHeaderFooter before
printing the toc at the end...
But i really would like to print the number if possible.

So: How can I set a page number to a specific page?

Thanks for any hint
   Sorin

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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