I’m getting an exception in Unix environment in the following code snippet
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(new ByteArrayInputStream(pdfbyteArrayContent));
Exception:
Caused by: com.aspose.pdf.internal.ms.System.l6n: Cannot find any fonts installed on the system.
Please guide on fixing this issue as well
@hai2xavier
Thanks for contacting support.
We have tested the scenario in Ubuntu OS 15.04 by loading attached PDF document shared by you in other forum thread. We were unable to notice any issue that you have mentioned. Would you please make sure that you have all essential Microsoft Core fonts installed at your end. In case you still face any issue, please let us know by sharing complete Stack Trace you are receiving.
output.pdf (1.2 MB)
Stack Trace ::
com.xxx.xxx.bo.exception.xxxBusinessException: Exception occurred while generating Preview Fax
at com.xxx.xxx.bo.XXXBOImpl.previewFaxImage(XXXBOImpl.java:712)
at com.xxx.xxx.bo.XXXBOImpl$$FastClassBySpringCGLIB$$8e6564fb.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.xxx.xxx.bo.XXXBOImpl$$EnhancerBySpringCGLIB$$c3805d34.previewFaxImage()
at com.xxx.xxx.mediator.XXXMediator.createXXXFaxImage(XXXMediator.java:299)
at com.xxx.xxx.mediator.XXXMediator$$FastClassBySpringCGLIB$$3839caa7.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.xxx.xxx.mediator.XXXMediator$$EnhancerBySpringCGLIB$$ee479b8.createXXXFaxImage()
at com.xxx.xxxweb.controller.XXXController.createXXXFaxImage(XXXController.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3980)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1016)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: com.xxx.xxx.bo.exception.xxxBusinessException: Exception occurred while appending the fax image
at com.xxx.xxx.bo.XXXBOImpl.buildFaxImage(XXXBOImpl.java:1012)
at com.xxx.xxx.bo.XXXBOImpl.previewFaxImage(XXXBOImpl.java:685)
… 71 more
Caused by: class com.aspose.pdf.internal.ms.System.l6n: Cannot find any fonts installed on the system.
com.aspose.pdf.internal.l24f.lv.lI(Unknown Source)
com.aspose.pdf.internal.l24f.lv.lI(Unknown Source)
com.aspose.pdf.internal.l24f.lv.lI(Unknown Source)
com.aspose.pdf.internal.l87t.lv.lI(Unknown Source)
com.aspose.pdf.internal.l87t.l0l.lI(Unknown Source)
com.aspose.pdf.internal.l0n.l0l.lI(Unknown Source)
com.aspose.pdf.internal.l0n.l0l.lI(Unknown Source)
com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
com.aspose.pdf.internal.l0y.l0if.lI(Unknown Source)
com.aspose.pdf.internal.l0n.lc.lI(Unknown Source)
com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
com.aspose.pdf.internal.l0y.lk.lI(Unknown Source)
com.aspose.pdf.internal.l0n.lu.lI(Unknown Source)
com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
com.aspose.pdf.internal.l0y.l0l.lI(Unknown Source)
com.aspose.pdf.internal.l0n.lv.lj(Unknown Source)
com.aspose.pdf.internal.l0n.lv.lI(Unknown Source)
com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
com.aspose.pdf.internal.l0y.lh.lI(Unknown Source)
com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
com.aspose.pdf.internal.l0y.lf.lI(Unknown Source)
com.aspose.pdf.internal.l87t.le.lt(Unknown Source)
com.aspose.pdf.internal.l0n.lf.lI(Unknown Source)
com.aspose.pdf.l3k.lI(Unknown Source)
com.aspose.pdf.ADocument.lj(Unknown Source)
com.aspose.pdf.ADocument.lj(Unknown Source)
com.aspose.pdf.ADocument.lf(Unknown Source)
com.aspose.pdf.Document.lf(Unknown Source)
com.aspose.pdf.ADocument.save(Unknown Source)
com.aspose.pdf.Document.save(Unknown Source)
com.xxx.xxx.bo.XXXBOImpl.buildFaxImage(XXXBOImpl.java:999)
com.xxx.xxx.bo.XXXBOImpl.previewFaxImage(XXXBOImpl.java:685)
com.xxx.xxx.bo.XXXBOImpl$$FastClassBySpringCGLIB$$8e6564fb.invoke()
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
com.xxx.xxx.bo.XXXBOImpl$$EnhancerBySpringCGLIB$$c3805d34.previewFaxImage()
com.xxx.xxx.mediator.XXXMediator.createXXXFaxImage(XXXMediator.java:299)
com.xxx.xxx.mediator.XXXMediator$$FastClassBySpringCGLIB$$3839caa7.invoke()
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
com.xxx.xxx.mediator.XXXMediator$$EnhancerBySpringCGLIB$$ee479b8.createXXXFaxImage()
com.xxx.xxxweb.controller.XXXController.createXXXFaxImage(XXXController.java:375)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
java.lang.reflect.Method.invoke(Method.java:508)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3980)
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1016)
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
at com.aspose.pdf.internal.l24f.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l24f.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l24f.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l87t.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l87t.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
at com.aspose.pdf.internal.l0y.l0if.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.lc.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
at com.aspose.pdf.internal.l0y.lk.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.lu.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
at com.aspose.pdf.internal.l0y.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.lv.lj(Unknown Source)
at com.aspose.pdf.internal.l0n.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
at com.aspose.pdf.internal.l0y.lh.lI(Unknown Source)
at com.aspose.pdf.internal.l0n.le.lI(Unknown Source)
at com.aspose.pdf.internal.l0y.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l87t.le.lt(Unknown Source)
at com.aspose.pdf.internal.l0n.lf.lI(Unknown Source)
at com.aspose.pdf.l3k.lI(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.Document.lf(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)
at com.xxx.xxx.bo.XXXBOImpl.buildFaxImage(XXXBOImpl.java:999)
… 72 more
@hai2xavier
Thanks for sharing stack trace.
We are testing the scenario in our environment and will get back to you shortly. In the meanwhile please try using following method before loading the PDF document:
Document.addLocalFontPath();
@hai2xavier
Thanks for your patience.
We have tested the scenario in our environment using spring-boot application and were still unable to replicate the error which you have mentioned. It is requested if you can please share a sample application with us which is able to replicate the issue. We will again test the scenario in our environment and address it accordingly.