Jump to content
Changes to the Jaspersoft community edition download ×

JRException:Can't read font file (*.ttf) on linux


anonymous_user

Recommended Posts

JRException Can't read font file (*.ttf) on linux

 

 

Hello everybody,

 

I have a problem with reading file font (ex: Arial.ttf) on linux server

I export the jasper report from my java code, and set a folder for fonts (arabic fonts) under fonts folder on my application

and my java code set PDF font of jasper report to refer to font under this path (ex: /xxx/fonts/Arial.ttf) and set PDFEncoding to be Identity-H to support Arabic and English letters

it works well for me on windows servers for both browsers (internet explorer and Mozilla firefox).

But on linux servers when calling report the page appears blank on firefox browser and i found the following exception:

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

pdfFontName : /usr/local/tomcat/webapps/xxx/fonts/Arial.ttf

pdfEncoding : Identity-H

isPdfEmbedded : true

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

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

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

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

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

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

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

at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdf(JasperExportManager.java:188)

at com.company.presentation.Report.PrintReport(Report.java:130)

at com.company.presentation.Report.Print(Report.java:72)

at com.company.presentation.Report.TestAction.PrintUnique(TestAction.java:637)

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:585)

at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)

at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)

at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)

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

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 ma.fmcp.presentation.UTF8Filter.doFilter(UTF8Filter.java:28)

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:869)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) 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)

 

 

 

Any help will be appreciated.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...