Gordon Luk wrote:

> Hi all,
>
> Sorry, i am not family in servlet, i would like to ask, which location i
> have to place the fonts(TTF) & iText.jar at servlet/Container?
>
> iText.jar in tomcat/lib/ext ? or in my war (/WEB-INF)
>

If you don't use iText for only one application, or you have rights for put
anywhere this file

=> tomcat/lib/ext or system

I you use iText for one application or you hosted your application on server
that have not yet installed iText => /WEB-INF/lib


> TTF in my war (/WEB-INF)?

I think yes. I have fonts in /WEB-INF/fonts.
But I have it specified in web.xml as servletContext initParam

example:

web.xml:
  <context-param>
    <param-name>fontPath</param-name>
    <param-value>/WEB-INF/fonts</param-value>
    <description>Cesta k k fontum v listinach v PDF</description>
  </context-param>

AbstractInitServlet <=my parent for servlets that create PDF files
This is actual version, but when Bruno write static parameters in the
FontFactory I rewrite code for using this Factory.

HashMap arial;
String pathToFonts =
getServletContext().getRealPath(getServletContext().getInitParameter("fontPath"))
+ File.separator;
arial.put(STANDARD,BaseFont.createFont(pathToFonts +
"Arial.ttf",BaseFont.IDENTITY_H,EMBEDDED));
arial.put(BOLD,BaseFont.createFont(pathToFonts +
"Arialbd.ttf",BaseFont.IDENTITY_H,EMBEDDED));
arial.put(ITALIC,BaseFont.createFont(pathToFonts +
"Ariali.ttf",BaseFont.IDENTITY_H,EMBEDDED));
arial.put(BOLDITALIC,BaseFont.createFont(pathToFonts +
"Arialbi.ttf",BaseFont.IDENTITY_H,EMBEDDED));

times.put(STANDARD,BaseFont.createFont(pathToFonts +
"Times.ttf",BaseFont.IDENTITY_H,EMBEDDED));
times.put(BOLD,BaseFont.createFont(pathToFonts +
"Timesbd.ttf",BaseFont.IDENTITY_H,EMBEDDED));
times.put(ITALIC,BaseFont.createFont(pathToFonts +
"Timesi.ttf",BaseFont.IDENTITY_H,EMBEDDED));
times.put(BOLDITALIC,BaseFont.createFont(pathToFonts +
"Timesbi.ttf",BaseFont.IDENTITY_H,EMBEDDED));


Lumi

>
> Please Advise, thanks.
>
> Gordon
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions


_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to