Error: Cannot find any fonts installed on the system

Hello everone,


I have a problem with lib aspose(pdf). When a run my aplication in UNIX/LINUX(In Windows works) show the message:
Caused by: class com.aspose.pdf.internal.p391.z93: Cannot find any fonts installed on the system.

I saw some foruns and already put in code the follow line:
Document.setLocalFontPath (Path fonts)

But the error continue.

Can anybody help me?

Hi Rafael,

Thanks for your inquiry. Yes your are right when using Aspose.Pdf for Java on operating system other than Windows, you need to set font folder path according to your system before start any processing as following. You can use following methods to get system folder of fonts or set font path to font folders.
  • Document.getLocalFontPath () - shows the system folder in which project will look for fonts.
  • Document.setLocalFontPath (String) - Setting font path to custom folder

// Set font folder path
String path = "/usr/share/fonts/truetype/msttcorefonts/";
// Adding a single font directory
// com.aspose.pdf.Document.addLocalFontPath(path);

// setting the user list for standard font directories
java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();
list.add(path);

.....
.....

Please double check the font folder path setting and if the issue persist then please share your sample code and source documents here, we will test the scenario and will guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

I did it, but doesn’t worked. i put my fonts in the path:

/home/wxime/public_ftp/fontes

And when i printed the code Document.getLocalFontPaths(), i can see:

[%WINDIR%/Fonts/, /usr/openwin/lib/X11/fonts/TrueType/, /usr/local/share/fonts/, $home/.fonts/, /usr/share/fonts/truetype/, /usr/X11R6/lib/X11/fonts/ttfonts/, /Library/Fonts/, ~/Library/Fonts/, /Network/Library/Fonts/, /System/Library/Fonts/, ~/.fonts/, /usr/share/fonts/, /usr/share/X11/fonts/TTF/, /system/fonts/, /home/wxime/public_ftp/fontes]


But after that the same error happen:

aused by: class com.aspose.pdf.internal.p391.z93: Cannot find any fonts installed on the system.

Hi Rafael,


Thanks for your feedback. Please add a “/” front slash at the end of your font path and add in LocalFontPaths. Hopefully it will resolve the issue. However if issue persist then please share your sample code and source document, so we will test the scenario and will update you accordingly.

/home/wxime/public_ftp/fontes/

We are sorry for the inconvenience caused.

Best Regards,
I rented a server linux, but the server is shared with other users, so i don´t install any fonts. Then i just copied all my fonts(.ttf) in Windows7 system and put in this path : /home/wxime/public_ftp/fontes/

My code is:

public static String converterPdftoWorld(String pathInput) {
int indexExt = pathInput.lastIndexOf(".");
int indexLastB = pathInput.lastIndexOf(File.separator);
String nameFile = pathInput.substring(indexLastB + 1,
indexExt);
String pathWithoutFileName = pathInput.substring(0, indexLastB);
String pathReturn = pathWithoutFileName + File.separator + nameFile
+ "_DOC.doc";

// Open the source PDF document
String path = "/home/wxime/public_ftp/fontes/";
com.aspose.pdf.Document.addLocalFontPath(path);
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(
pathInput);
com.aspose.pdf.Document.addLocalFontPath(path);
com.aspose.pdf.Document.getLocalFontPaths();
// Save the file into Microsoft document format
pdfDocument.save(pathReturn, com.aspose.pdf.SaveFormat.Doc);
return pathReturn;
}


the log print this error:

javax.el.ELException: /pages/utilitario/pdf/index.xhtml @130,75 value="#{manipulaArquivoBean.fileDownload}": Error reading 'fileDownload' on type controle.ManipulaArquivoBean
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at org.primefaces.component.filedownload.FileDownloadActionListener.processAction(FileDownloadActionListener.java:55)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:778)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at util.AuthFilterAdm.doFilter(AuthFilterAdm.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: class com.aspose.pdf.internal.p391.z93: Cannot find any fonts installed on the system.
com.aspose.pdf.internal.p184.z10.m1(Unknown Source)
com.aspose.pdf.internal.p184.z10.m1(Unknown Source)
com.aspose.pdf.internal.p184.z10.m1(Unknown Source)
com.aspose.pdf.internal.p701.z16.(Unknown Source)
com.aspose.pdf.internal.p700.z13.m1(Unknown Source)
com.aspose.pdf.internal.p701.z1.m37(Unknown Source)
com.aspose.pdf.internal.p701.z1.(Unknown Source)
com.aspose.pdf.internal.p700.z13.m1(Unknown Source)
com.aspose.pdf.internal.p630.z5.(Unknown Source)
com.aspose.pdf.internal.p667.z2.m1(Unknown Source)
com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
com.aspose.pdf.ApsUsingConverter.m2(Unknown Source)
com.aspose.pdf.z23.m1(Unknown Source)
com.aspose.pdf.ADocument.m1(Unknown Source)
com.aspose.pdf.Document.m1(Unknown Source)
com.aspose.pdf.ADocument.m2(Unknown Source)
com.aspose.pdf.Document.m2(Unknown Source)
com.aspose.pdf.ADocument.save(Unknown Source)
com.aspose.pdf.Document.save(Unknown Source)
util.AdvocaciaPdf.converterPdftoWorld(AdvocaciaPdf.java:621)
controle.ManipulaArquivoBean.getFileDownload(ManipulaArquivoBean.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
javax.el.BeanELResolver.getValue(BeanELResolver.java:99)
com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
org.apache.el.parser.AstValue.getValue(AstValue.java:183)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
org.primefaces.component.filedownload.FileDownloadActionListener.processAction(FileDownloadActionListener.java:55)
javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:778)
javax.faces.component.UICommand.broadcast(UICommand.java:300)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
util.AuthFilterAdm.doFilter(AuthFilterAdm.java:71)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
at com.aspose.pdf.internal.p184.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p184.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p184.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p701.z16.(Unknown Source)
at com.aspose.pdf.internal.p700.z13.m1(Unknown Source)
at com.aspose.pdf.internal.p701.z1.m37(Unknown Source)
at com.aspose.pdf.internal.p701.z1.(Unknown Source)
at com.aspose.pdf.internal.p700.z13.m1(Unknown Source)
at com.aspose.pdf.internal.p630.z5.(Unknown Source)
at com.aspose.pdf.internal.p667.z2.m1(Unknown Source)
at com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
at com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
at com.aspose.pdf.ApsUsingConverter.m2(Unknown Source)
at com.aspose.pdf.z23.m1(Unknown Source)
at com.aspose.pdf.ADocument.m1(Unknown Source)
at com.aspose.pdf.Document.m1(Unknown Source)
at com.aspose.pdf.ADocument.m2(Unknown Source)
at com.aspose.pdf.Document.m2(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)
at util.AdvocaciaPdf.converterPdftoWorld(AdvocaciaPdf.java:621)
at controle.ManipulaArquivoBean.getFileDownload(ManipulaArquivoBean.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:99)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstValue.getValue(AstValue.java:183)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
... 36 more

Cannot find any fonts installed on the system.

Hi Rafael,


Thanks for sharing additional information. After initial investigation, we have logged ticket PDFNEWJAVA-35276 in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress within this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

I’m also experiencing this issue in an HPUX environment. I’m just replying to this thread so that I get updated on any fixes or workarounds.

BrettMSD:
I'm also experiencing this issue in an HPUX environment. I'm just replying to this thread so that I get updated on any fixes or workarounds.
Hi Brett,

Thanks for contacting support.

Can you please share if you are getting the issue while manipulating any specific document or its appearing for all the files. Also please share some details regarding the operation which you are trying to perform using our API. We are sorry for this inconvenience.

Any idea about my problem?


Tks
rafaximenes1:
Any idea about my problem?
Hi Rafael,

Thanks for your patience.

As we recently have been able to notice this issue, so its still pending fore review. The team has been busy fixing other previously reported high priority issues and as soon as schedule permits, the team will surely consider fixing this problem. Please be patient and spare us little time. We are sorry for this delay and inconvenience.
Hi Rafael

rafaximenes1:
Any idea about my problem?

Tks

In addition to above reply, we have good news for you that above reported issue has been resolved and after testing and integration its fix will be included in upcoming release of Aspose.Pdf for Java i.e. 11.0.0. However we will notify you as soon as Aspose.Pdf for Java 11.0.0 is published.

Thanks for your patience and cooperation.

Best Regards,

Hi,


Can you please provide an ETA on the fix, also will you be providing a free hot fix for this issue now ?

Cheers

.Hi Nayyar,

I'm getting the error when converting a simple HTML string into a PDF. Convert a word document works fine.

I use the following code for the conversion:

try (InputStream inStream = new ByteArrayInputStream(htmlString.getBytes(StandardCharsets.UTF_8))) {

com.aspose.pdf.HtmlLoadOptions htmloptions = new com.aspose.pdf.HtmlLoadOptions();

com.aspose.pdf.Document document = new com.aspose.pdf.Document(inStream, htmloptions);

document.save(filename);

}

I have a folder with fonts and I add the fonts like this:

com.aspose.pdf.Document.addLocalFontPath(fontDeploymentDirectory.getAbsolutePath() + "/");

I also use FontSettings to load fonts.

I get the following stack trace when creating a new Document object:

class com.aspose.pdf.internal.ms.System.z93: Cannot find any fonts installed on the system.

com.aspose.pdf.internal.p307.z10.m1(Unknown Source)

com.aspose.pdf.internal.p307.z10.m1(Unknown Source)

com.aspose.pdf.internal.p307.z10.m1(Unknown Source)

com.aspose.pdf.internal.p193.z2.m1(Unknown Source)

com.aspose.pdf.internal.p192.z10.m1(Unknown Source)

com.aspose.pdf.internal.p203.z3.m1(Unknown Source)

com.aspose.pdf.internal.p175.z33.(Unknown Source)

com.aspose.pdf.internal.p175.z5.m1(Unknown Source)

com.aspose.pdf.internal.p175.z5.(Unknown Source)

com.aspose.pdf.internal.p202.z23.m1(Unknown Source)

com.aspose.pdf.internal.p183.z13.(Unknown Source)

com.aspose.pdf.internal.p174.z4.m4(Unknown Source)

com.aspose.pdf.internal.p174.z4.(Unknown Source)

com.aspose.pdf.internal.p174.z5.m1(Unknown Source)

com.aspose.pdf.internal.p170.z22.m1(Unknown Source)

com.aspose.pdf.internal.p170.z22.m1(Unknown Source)

com.aspose.pdf.internal.p346.z1.m1(Unknown Source)

com.aspose.pdf.internal.p346.z1.m1(Unknown Source)

com.aspose.pdf.z34.m1(Unknown Source)

com.aspose.pdf.ADocument.m1(Unknown Source)

com.aspose.pdf.ADocument.(Unknown Source)

com.aspose.pdf.Document.(Unknown Source)

Hopefully my issue is identical and will be addressed in version 11.

Hi Brett,
BrettMSD:
Hi,

Can you please provide an ETA on the fix, also will you be providing a free hot fix for this issue now ?

Cheers

Thanks for your inquiry. Hopefully Aspose.Pdf for Java 11.0.0 will be released in first week of December 2015. I am afraid we can not provide a hot fix as pre-release, you have to wait for normal release. We will notify you as soon as it is resolved.

Thanks for your patience and cooperation.

Best Regards,
BrettMSD:

.Hi Nayyar,

I'm getting the error when converting a simple HTML string into a PDF. Convert a word document works fine.

I use the following code for the conversion:

try (InputStream inStream = new ByteArrayInputStream(htmlString.getBytes(StandardCharsets.UTF_8))) {

com.aspose.pdf.HtmlLoadOptions htmloptions = new com.aspose.pdf.HtmlLoadOptions();

com.aspose.pdf.Document document = new com.aspose.pdf.Document(inStream, htmloptions);

document.save(filename);

}

I have a folder with fonts and I add the fonts like this:

com.aspose.pdf.Document.addLocalFontPath(fontDeploymentDirectory.getAbsolutePath() + "/");

I also use FontSettings to load fonts.

I get the following stack trace when creating a new Document object:

class com.aspose.pdf.internal.ms.System.z93: Cannot find any fonts installed on the system.

com.aspose.pdf.internal.p307.z10.m1(Unknown Source)

com.aspose.pdf.internal.p307.z10.m1(Unknown Source)

com.aspose.pdf.internal.p307.z10.m1(Unknown Source)

com.aspose.pdf.internal.p193.z2.m1(Unknown Source)

com.aspose.pdf.internal.p192.z10.m1(Unknown Source)

com.aspose.pdf.internal.p203.z3.m1(Unknown Source)

com.aspose.pdf.internal.p175.z33.(Unknown Source)

com.aspose.pdf.internal.p175.z5.m1(Unknown Source)

com.aspose.pdf.internal.p175.z5.(Unknown Source)

com.aspose.pdf.internal.p202.z23.m1(Unknown Source)

com.aspose.pdf.internal.p183.z13.(Unknown Source)

com.aspose.pdf.internal.p174.z4.m4(Unknown Source)

com.aspose.pdf.internal.p174.z4.(Unknown Source)

com.aspose.pdf.internal.p174.z5.m1(Unknown Source)

com.aspose.pdf.internal.p170.z22.m1(Unknown Source)

com.aspose.pdf.internal.p170.z22.m1(Unknown Source)

com.aspose.pdf.internal.p346.z1.m1(Unknown Source)

com.aspose.pdf.internal.p346.z1.m1(Unknown Source)

com.aspose.pdf.z34.m1(Unknown Source)

com.aspose.pdf.ADocument.m1(Unknown Source)

com.aspose.pdf.ADocument.(Unknown Source)

com.aspose.pdf.Document.(Unknown Source)

Hopefully my issue is identical and will be addressed in version 11.

Hi Rafael

Thanks for sharing the details. It appears that a simple HTML file referencing fonts currently missing over system where conversion is being performed is being failed. Furthermore from above statement, I can see that an exception is being generated when trying to get font information over system. Can you please share some details regarding your Operating system and JDK version you are using. We are sorry for this inconvenience.

Hi Nayyar<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We are running on HP-UX B.11.31 ia64

Java -version gives me:

java version "1.7.0.03"

Java(TM) SE Runtime Environment (build 1.7.0.03-jinteg_2012_10_05_02_40-b00)

Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09-jre1.7.0.03-rc1, mixed mode)

Cheers Brett

Why is there no hot fix available if you know that this is an issue ? Why make us wait another 2 weeks with a production fault ?

Hi Rafael,


I am in coordination with product team to see if we can prepare a hotfix for your earlier reported issue, before next release of Aspose.Pdf for Java is published. As soon as we have some further updates, we will let you know.

Hi Rafael,


I have further discussed with product team and we plan to release new release of Aspose.Pdf for Java starting next week. Do you think next week’s time-frame is acceptable.

Thanks very much Aspose Team, I´m looking for my release :wink: