Hi Pietschmann,
Thanks you.I am able to generate font metrics file. Also I have sucessfully
generated PDF with all Characters. But from the Application it is not
working.Here in my jsp i have mentioned like this.
File userConfigFile = new
File(application.getRealPath(System.getProperty("file.separator"))+System.getProperty("file.separator")+"WEB-INF"+System.getProperty("file.separator")+"userconfig.xml");
Options options = new Options(userConfigFile);
response.setContentType("application/pdf");
response.addHeader("Content-Disposition","attachment;filename=APLAC_"+ptlNumber+".pdf");
Driver driver = new Driver();
driver.setLogger(log);
driver.setRenderer(Driver.RENDER_PDF);
driver.setOutputStream(out1);
driver.render(inputHandler.getParser(), inSource); byte[] content =
out1.toByteArray();
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();
userconfig.xml file is as:
<!--<!DOCTYPE configuration SYSTEM "config.dtd">-->
<!--
this file contains templates which allow an user easy
configuration of Fop. Actually normally you don't need this
configuration
file, but if you need to change configuration, you should
always use this file and *not* config.xml.
Usage: java org.apache.fop.apps.Fop -c userconfig.xml -fo fo-file -pdf
pdf-file
-->
<configuration>
<!--
baseDir: normally the base directory is the directory where the fo file is
located. if you want to specify your own, uncomment this entry.
This value can also be a URL. Actually, the value is converted to
a URL.
-->
<!--
<entry>
<key>baseDir</key>
<value></value>
</entry>
-->
<!--
fontBaseDir: Similar to baseDir, except that this value is used for fonts.
If
it isn't specified, the value from baseDir is used.
-->
<entry>
<key>fontBaseDir</key>
<value></value>
</entry>
<!--
************************************************************************
HYPHENATION
************************************************************************
-->
<!--
hyphenation directory
if you want to specify your own directory with hyphenation pattern
then uncomment the next entry and add the directory name
-->
<!--
<entry>
<key>hyphenation-dir</key>
<value>/java/xml-fop/hyph</value>
</entry>
-->
<!--
************************************************************************
Add fonts here
************************************************************************
-->
<fonts>
<!-- example -->
<font metrics-file="C:\Java\Tomcat-4.1\webapps\glaxo\arialuni.xml"
embed-file="c:/winnt/fonts/Arialuni.TTF" kerning="yes">
<font-triplet name="ArialUnicodeMS" style="normal" weight="normal"/>
<font-triplet name="ArialUnicodeMS" style="normal" weight="bold"/>
<font-triplet name="ArialUnicodeMS" style="italic" weight="normal"/>
<font-triplet name="ArialUnicodeMS" style="italic" weight="bold"/>
</font>
</fonts>
</configuration>
I have tried with all type of paths like
http://localhost:8090/glaxo/arialuni.xml.
But i am getting the following Exception:
exception typenull
org.apache.jasper.JasperException
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:254)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:432)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:356)
at
com.as.web.framework.ControlServlet.doGet(ControlServlet.java:162)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2417)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
3)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:781)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:549)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:589)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:666)
at java.lang.Thread.run(Thread.java:534)
If i mention "ArialUnicodeMS" font-family in XSL.then only I am getting this
exception.Otherwise it will open PDF with normal old font.
What might be the reason?. Please help me.
Regards,
LALITH
From: "J.Pietschmann" <[EMAIL PROTECTED]>
Reply-To: fop-dev@xmlgraphics.apache.org
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP Supports Multiple Charset ?
Date: Mon, 13 Jun 2005 22:24:36 +0200
Lalitha Prasad wrote:
While generating font metrics file . I am getting the following
exception:
[snip]
javax.xml.transform.TransformerException: java.io.FileNotFoundException:
file:\C
:\Java\fop-0.20.5\arialuni.xml (The filename, directory name, or volume
Ouch!
Try one of the following:
1. Create the mmetrics file in the local directory and move it later to
its final destination
java -cp
"fop.jar;avalon-framework.jar;xml-apis.jar;xercesImpl-2.2.1.jar;xalan-2.4.1.jar"
org.apache.fop.fonts.apps.TTFReader C:\Java\fop-0.20.5\Arialuni.ttf
arialuni.xml
2. Try a file URL for the metrics file:
java -cp
"fop.jar;avalon-framework.jar;xml-apis.jar;xercesImpl-2.2.1.jar;xalan-2.4.1.jar"
org.apache.fop.fonts.apps.TTFReader C:\Java\fop-0.20.5\Arialuni.ttf
file:///C:/Java/fop-0.20.5/arialuni.xml
J.Pietschmann
_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/