Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] adding page number at the end of each page using Header Footer

Kurakula, Suneetha (HCF)

2005-05-18

Replies:

Hi ,

 

I am trying to add page number at the end of each page using

 

   public void onEndPage(PdfWriter writer, Document document)

    {

        try

        {

          HeaderFooter footer =  new HeaderFooter(new Phrase("This is page "), true);

          footer.setAlignment(Element.ALIGN_CENTER);

            document.setFooter(footer);

 

        }

        catch(Exception e)

        {

                e.printStackTrace();

        }

    }

 

 

I am using Table objects since our data is dynamic and document is controlling if it should go to new  page or not.

But problem is page number is not displayed in first page and it is displaying in second page.Can any one please help me out.?

 

Thanks,

Suneetha.

 

 

©2008 junlu.com - Jax Systems, LLC, U.S.A.