Op 28/12/2010 13:32, Johann Pérez schreef:
> Hello,
>
> I have already seen some examples of how to put page numbers and total
> pages using templates.
> What I cannot figure out is how to add page number and total pages
> between some other content.
>
> In our application pdf documents are built from some meta-data so
> headers and footers are made with a pdftable where we put images, user
> name, title etc etc and combinations of them according to the meta-data
> we receive.
> So, even tough it may sound strange, we may have things like<title>  + "
> " + page number + translate("out of",<userlanguage>) + total number of
> pages +<some other text>  +<an image>  and any kind of combination so if
> I wanted to use templates I should know the exact position where
> pagenumber or total pages should be which depends not only of the
> combination but also of the pdftable and cells size (height is not
> bounded), text font, etc etc which it seems quite difficult to achieve...
>
> I would appreciate any ideas.
The methods in page events as well as in table and cell events give you 
access to a PdfWriter object. This allows you to get the current page 
number. As for the total number of pages: this should be obtained from 
the onCloseDocument method as is done in the "page X of Y" examples 
you're referring to.
In the examples, you're referring to, the onEndPage() method is used. As 
you want to add the page numbers "inside the content", you should choose 
another method, such as onGenericTag() or, as you refer to PdfPTable: in 
a table or cell event.
Given this information, what is your question?

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to