xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: PFBParser - ArrayIndexOutOfBoundsException
Date Thu, 16 Feb 2006 08:28:57 GMT
One day we have to add code that identifies the file type so we can give
a more meaningful error message. The error is easily fixed, see inline
below...

On 16.02.2006 05:12:17 Grant McAuley wrote:
> I am trying to embed a Type1 font in a PDF using fop 0.91beta in a servlet and
> am seeing the exception below.  When I do not embed fonts but use a Base font
> like 'Times', everything works fine. 
> 
> Googling org.apache.fop.fonts.type1.PFBParser ArrayIndexOutOfBoundsException
> only gave links to fop-x.x.x-.tar.gz files, and searching fop forum archives
> did not give any relevant results.
> 
> I am hoping that someone could give me some thoughts on how to track this
> problem down.
> 
> 
> Here is a portion of my .conf file:
> 
> 
> <font metrics-url="/home/grant/cert/build/web/caslon3.xml" kerning="yes"
> embed-url="file:///home/grant/cert/build/web/CTR_____.PFM">

                                                   ^^^^^^^^^^^^^^^^

"embed-url" must reference the PFB (!) file, not the PFM files. The PFB
contains the font. The PFM only contains font metrics but they are
already available in the XML file.

>     <font-triplet name="caslon3" style="normal" weight="normal"/>
>     <font-triplet name="caslon3" style="normal" weight="bold"/>
> </font>
> 
> 
> Here is a portion of my XSLT style sheet that refers to the font:
> 
> <fo:block font-family="caslon3" font-size="14pt" font-style="normal"
> font-weight="normal" space-after="14pt" text-align="center"> has completed
> education in </fo:block>
> 
> 
> Here is the exception that I am seeing:
> 
> 
> java.lang.ArrayIndexOutOfBoundsException: 1067
>         at org.apache.fop.fonts.type1.PFBParser.byteCmp(PFBParser.java:166)
>         at org.apache.fop.fonts.type1.PFBParser.calcLengths(PFBParser.java:183)
>         at org.apache.fop.fonts.type1.PFBParser.parseRAWFormat
> (PFBParser.java:232)
>         at org.apache.fop.fonts.type1.PFBParser.parsePFB(PFBParser.java:99)
>         at org.apache.fop.pdf.PDFFactory.makeFontFile(PDFFactory.java:1166)
>         at org.apache.fop.pdf.PDFFactory.makeFontDescriptor
> (PDFFactory.java:1088)
>         at org.apache.fop.pdf.PDFFactory.makeFont(PDFFactory.java:976)
>         at org.apache.fop.pdf.PDFResources.addFonts(PDFResources.java:101)
>         at org.apache.fop.render.pdf.PDFRenderer.stopRenderer
> (PDFRenderer.java:266)
>         at
> org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:228)
>         at org.apache.fop.area.AreaTreeHandler.endDocument
> (AreaTreeHandler.java:326)
>         at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:246)
>         at
> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endDocument
> (ToXMLSAXHandler.java:182)
>         at cert.transform()
>         at
> com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform
> (AbstractTranslet.java:594)
>         at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform
> (TransformerImpl.java:640)
>         at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform
> (TransformerImpl.java:279)
>         at cert.TrainingCert.render(TrainingCert.java:288)
>         at cert.TrainingCert.renderXML(TrainingCert.java:246)
>         at cert.TrainingCert.doGet(TrainingCert.java:156)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:252)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:173)
>         at
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter
> (MonitorFilter.java:362)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:173)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke
> (StandardWrapperValve.java:213)
>         at
> org.apache.catalina.core.StandardContextValve.invoke
> (StandardContextValve.java:178)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke
> (StandardEngineValve.java:107)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler
> .processConnection
> (Http11Protocol.java:744)
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> (PoolTcpEndpoint.java:527)
>         at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
> (LeaderFollowerWorkerThread.java:80)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> (ThreadPool.java:684)
>         at java.lang.Thread.run(Thread.java:595)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message