Jump to content
Changes to the Jaspersoft community edition download ×

Help me, Exception when export to pdf


tinhlh

Recommended Posts

Hi

I'm using iReport to make file jrxml, and then in my java code, I call export to pdf. But show the Error :

( I think it because of I define pdf Font in iReport)

 

net.sf.jasperreports.engine.JRException: Could not load the following font :

pdfFontName : arial.ttf

pdfEncoding : Identity-H

isPdfEmbedded : true

 

at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1429)

 

at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1352)

 

at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:1658)

 

at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:549)

 

at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:513)

 

at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:478)

 

at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:288)

 

at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:126)

 

at com.fss.isp.bean.JasperReportBean.buildReport(JasperReportBean.java:113)

 

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

 

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

 

at java.lang.reflect.Method.invoke(Method.java:324)

 

at com.fss.ddtp.Processor.processRequest(Processor.java:62)

 

at com.fss.ddtp.ServletServer.service(ServletServer.java:65)

 

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

 

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

 

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

 

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

 

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

 

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

 

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

 

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

 

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

 

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

 

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

 

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

 

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

 

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

 

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

 

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

 

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

 

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

 

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

 

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

 

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

 

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

 

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

 

at java.lang.Thread.run(Thread.java:534)

 

 

 

So how can java understand these Fonts? (I'm using JBuilder 2005 )

Thanks very much

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Your problem could be solved by replacing

pdfFontName from "ARIAL.TTF" to "C:\WINDOWS\FONTS\ARIAL.TTF" then recompile your report jxml file and replace the the old .jasper file with the new one. As you can see that solution shows the font absolute path for the program so it could load it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...