xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JK...@lacare.org
Subject Embeding Unicode Font Causing Out of Memory
Date Thu, 21 Feb 2008 01:32:00 GMT
I am working on a project to generate pdf files in Chinese. It works fine 
when it runs stand alone. It causes a out of memory error when it is 
running on Tomcat 5.5. Here are some additional information:

Fop version:            0.94
Configuration File: 

<?xml version="1.0"?>
<fop version="1.0">
  <base>.</base>
  <source-resolution>72</source-resolution>
  <target-resolution>72</target-resolution>
  <default-page-settings height="11in" width="8.26in"/>
 
  <renderers>
    <renderer mime="application/pdf">
      <filterList>
        <value>flate</value>
      </filterList>

      <fonts>
        <font metrics-url="C:/arialuni.xml" embed-url=
"C:/windows/Fonts/arialuni.ttf" kerning="yes">
                <font-triplet name="arialuni" style="normal" weight=
"normal"/>
                <font-triplet name="arialuni" style="normal" weight="bold"
/>
                <font-triplet name="arialuni" style="italic" weight=
"normal"/>
                <font-triplet name="arialuni" style="italic" weight="bold"
/>
          </font> 
      </fonts>
    </renderer>
  </renderers>
</fop>

Error message:

Caused by: java.lang.OutOfMemoryError: Java heap space
        at org.apache.commons.io.output.ByteArrayOutputStream.toByteArray(
ByteArrayOutputStream.java:194)
        at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:216)
        at org.apache.fop.fonts.truetype.FontFileReader.init(
FontFileReader.java:45)
        at org.apache.fop.fonts.truetype.FontFileReader.<init>(
FontFileReader.java:74)
        at org.apache.fop.pdf.PDFFactory.makeFontFile(PDFFactory.java:1389
)
        at org.apache.fop.pdf.PDFFactory.makeFontDescriptor(
PDFFactory.java:1294)
        at org.apache.fop.pdf.PDFFactory.makeFont(PDFFactory.java:1179)
        at org.apache.fop.pdf.PDFResources.addFonts(PDFResources.java:109)
        at org.apache.fop.render.pdf.PDFRenderer.stopRenderer(
PDFRenderer.java:505)
        at org.apache.fop.area.RenderPagesModel.endDocument(
RenderPagesModel.java:245)
        at org.apache.fop.area.AreaTreeHandler.endDocument(
AreaTreeHandler.java:283)
        at org.apache.fop.fo.FOTreeBuilder.endDocument(
FOTreeBuilder.java:171)
        at 
org.apache.xalan.transformer.TransformerIdentityImpl.endDocument(
TransformerIdentityImpl.java:962)
        at org.jdom.output.SAXOutputter.endDocument(SAXOutputter.java:843)
        at org.jdom.output.SAXOutputter.output(SAXOutputter.java:634)
        at org.jdom.transform.JDOMSource$DocumentReader.parse(
JDOMSource.java:518)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(
TransformerIdentityImpl.java:484)

If I do not use configuration file, the applicaiton works fine except all 
Chinese characters are displayed as #. 

Could someone help me this out?



Jason Kong
Business Solutions
L.A. Care Health Plan
213 6941250 x4367


Mime
View raw message