Hi
I did that but getting this exception :
AZ.ttf cannot be embedded due to licensing restrictions. -
Can you please help me why this is ocurring ?? The code i have written is like
this :
BaseFont bf = BaseFont.createFont("AZ.ttf", BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
The ttf file is only put in the jar and the jar is in the classpath.
Thanks
Niladri.
----- Original Message ----
From: Paulo Soares <[EMAIL PROTECTED]>
To: Post all your questions about iText here
<[email protected]>
Sent: Thursday, 3 January, 2008 9:14:57 PM
Subject: Re: [iText-questions] Problem with Font creation.
Move the file inside a jar and get it from there. Suppose you put it in
mypackage.fonts.arial.ttf, the way to get out is
"/mypackage/fonts/arial.ttf" as long as that jar is in the classpath.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Schalk Neethling
> Sent: Thursday, January 03, 2008 3:14 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problem with Font creation.
>
> Niladri,
>
>
>
> So you fonr file is contained inside a WAR file, do I have
> that right? Any reason you cannot move it outside the WAR?
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Niladri Bhattacharyya
> Sent: 03 January 2008 03:33 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problem with Font creation.
>
>
>
> No Sir,
>
> if you check the api for this method this does not
> work for any file inside war. My file is inside the war.
>
> ----- Original Message ----
> From: Schalk Neethling <[EMAIL PROTECTED]>
> To: Post all your questions about iText here
> <[email protected]>
> Sent: Thursday, 3 January, 2008 6:59:42 PM
> Subject: Re: [iText-questions] Problem with Font creation.
>
> Ok, how about ServletContext.getRealPath(fileLoc);
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Niladri Bhattacharyya
> Sent: 03 January 2008 03:28 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problem with Font creation.
>
>
>
> Thats right sir, i tried that see below the code i written
>
>
>
> public class PrintServlet extends HttpServlet {
>
>
>
> public void init(ServletConfig config) {
>
> String fileLoc = config.getInitParameter("fontlocation");
>
> System.out.println("File loc " + fileLoc);
>
> }
>
>
>
> Now this code gives the path from the webapp location like :
> /font/AZ.ttf
>
>
>
> But I want the full path for the existing file in the system, i.e.
>
> C:\Workspace\CARAT_PL\res\LombardBusiness\webapp\font\AZ.ttf
>
>
>
> This is the problem.
>
>
>
> How can I get the path : C:\Workspace\CARAT_PL\res\LombardBusiness ??
>
>
>
> Thanks
>
> Niladri.
>
>
>
> ----- Original Message ----
> From: Schalk Neethling <[EMAIL PROTECTED]>
> To: Post all your questions about iText here
> <[email protected]>
> Sent: Thursday, 3 January, 2008 6:42:18 PM
> Subject: Re: [iText-questions] Problem with Font creation.
>
> Ok great! Then what you can do is create an init parameter
> for your servlet that provides the location of the font. The
> in your servlet you can use servlet context to get to that
> parameter as follows:
>
> String pathToFont =
> ServletContext.getInitParameter("nameOfFontInitParameter");
>
>
>
> Regards,
>
> Schalk Neethling
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Niladri Bhattacharyya
> Sent: 03 January 2008 03:09 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problem with Font creation.
>
>
>
> yes...absolutely...
>
> ----- Original Message ----
> From: Schalk Neethling <[EMAIL PROTECTED]>
> To: Post all your questions about iText here
> <[email protected]>
> Sent: Thursday, 3 January, 2008 6:33:48 PM
> Subject: Re: [iText-questions] Problem with Font creation.
>
> Do you have access to your web.xml?
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Niladri Bhattacharyya
> Sent: 03 January 2008 02:50 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problem with Font creation.
>
>
>
> yes, the font file is located inside my webapp folder of my
> web application
>
>
>
> The actual path is :
>
>
>
> C:\Workspace\CARAT_PL\res\LombardBusiness\webapp\font\AZ.ttf
>
>
>
> Please let me know if u have some solution I am still trying.
> thanks a lot for your interest.
>
>
>
> Thanks
>
> Niladri.
>
>
>
> ----- Original Message ----
> From: Schalk Neethling <[EMAIL PROTECTED]>
> To: Post all your questions about iText here
> <[email protected]>
> Sent: Thursday, 3 January, 2008 5:51:55 PM
> Subject: Re: [iText-questions] Problem with Font creation.
>
> Do you know where the font is located on your system?
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Niladri Bhattacharyya
> Sent: 03 January 2008 02:10 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problem with Font creation.
>
>
>
> Hi Schalk,
>
> Thanks a lot for your solution provided but
> for me that s of no use becayse for my application I do not
> have any access to the build files of my application. Is
> there any other way to create the Font for PDFs using iText ?
>
>
>
> Thanks
>
> Niladri.
>
> ----- Original Message ----
> From: Schalk Neethling <[EMAIL PROTECTED]>
> To: Post all your questions about iText here
> <[email protected]>
> Sent: Thursday, 3 January, 2008 4:23:27 PM
> Subject: Re: [iText-questions] Problem with Font creation.
>
> Greetings Nilardi,
>
>
>
> I created a properties file with an entry such as:
>
> wealthReportWeb.plugins.dir=${wealthReportWeb.webContent.dir}/
> WEB-INF/platform/plugins
>
> wealthReportWeb.fonts.dir=${wealthReportWeb.plugins.dir}/org.e
> clipse.birt...report.engine.fonts_2.2.1.v20070823/fonts/
>
>
>
> Inside my build.xml Ant script, I then have the following:
>
> <target name="createBirtConfigProperties">
>
> <propertyfile
> file="${wealthReportWeb.gensrc.dir}/BirtConfig.properties">
>
> <entry key="verdana"
> value="${wealthReportWeb.fonts.dir}/verdana.ttf" />
>
> </propertyfile>
>
> </target>
>
>
>
> Then inside my code I do the following:
>
> BaseFont bf =
> BaseFont.createFont(configProps.getString("verdana"),
> BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);
>
>
>
> HTH!
>
> Schalk Neethling
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Niladri Bhattacharyya
> Sent: 03 January 2008 12:47 PM
> To: [email protected]
> Subject: [iText-questions] Problem with Font creation.
>
>
>
> Hi
>
> I am unable to create the Font inside my servlet and my
> page events class. How to get the actual path of the Font
> file , can somebody help me ?
>
>
>
> the code written is :
>
>
>
> BaseFont bf = BaseFont.createFont(fontPathName, BaseFont..IDENTITY_H,
>
> BaseFont.EMBEDDED);
>
>
>
> Now this font path name must be the actual path of the file
> in the system. The file is put inside webapp folder, hence
> inside the .war file. This is required inside my page events
> class also.
>
>
>
> Please help me if possible.
>
>
>
> Thanks
>
> Niladri.
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
Forgot the famous last words? Access your message archive online at
http://in.messenger.yahoo.com/webmessengerpromo.php-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/