This is a generic internationalization problem, it doesn't depend on iText. 
I don't know what you'd expect iText to do.

Paulo
----- Original Message ----- 
From: "Paul Littlefield" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 01, 2006 1:28 AM
Subject: [iText-questions] i18n approach to footer "Page X of Y"


In the page events examples



http://itextdocs.lowagie.com/tutorial/directcontent/pageevents/index.htm
l#examples



there is an example of printing a footer with text for page numbers as
in "Page X of Y".



http://itextdocs.lowagie.com/examples/com/lowagie/examples/directcontent
/pageevents/PageNumbersWatermark.java



The code is not internationalized here and I don't see a way to do it as
the output string is built dynamically from different event handlers.
The "Page X of" text is built for each page in the onEndPage() method.
Then the string is augmented in the onCloseDocument() method with the
total page count.



Any advice on how to do this using an internationalized approach?   For
example:





      Object[] args = { new Integer(1), new Integer(3) };

      String pageXofY = MessageBundle.getString("pageXofY");

      MessageFormat format = new MessageFormat(getString(key), _locale);

      String localizedString = format.format(args);





In my message.properties file:



pageXofY = Page {0} of {1}



In the meantime I'll just list the page numbers as "Page X" and drop the
"of Y" part.



Thanks!



-Paul




--------------------------------------------------------------------------------


> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share 
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


--------------------------------------------------------------------------------


> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to