HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › can not read ‘arial’ from java:fonts/arial.ttf: problem read
- This topic has 8 replies, 3 voices, and was last updated Sep 08, 2015
16:16:39 by PD4ML.
-
AuthorPosts
-
April 14, 2015 at 08:21#27006
I get the following error (Screenshot.png) when I use the following fonts.jar : (These outputs are normally not seen on console, they only come when you enableDebugInfo on PD4ML)
1. Allfonts.jar provided by PD4ML (http://pd4ml.com/i/allfonts.zip)
2. Fonts jar I created using dejavu fonts.
3. Fonts jar offered by PD4ML (http://pd4ml.com/i/easyfonts/fonts.jar)There are also other similar threads from the forums but none of them have been convincingly answered.
There are similar issues reported on forums but I cannot seem to find a resolution to this :
pdf-generation-troubleshooting-f4/does-not-find-new-fonts-t206.html
pdf-generation-troubleshooting-f4/ttf-issues-pro-eval-version-3-8-vs-3-7-t520.html
pdf-generation-library-deployment-configuration-issues-f5/unix-fonts-deployment-t373.html
html-css-to-pdf-rendering-issues-f3/custom-fonts-t81.htmlCan you please help resolve this issue?
-Regards,
ManoojApril 14, 2015 at 13:42#29701The error is caused by IOException thrown in
java.awt.Font.createFont( Font.TRUETYPE_FONT, fontBytes )
call and usually caused by an attempt to load a custom font, which is not fully compatible with Java’s font subsystem. Usually the standard arial.ttf (for example from our sample fonts.jar) causes no problem.
Can you reproduce the problem when run PD4ML in command line mode?
April 15, 2015 at 10:46#29702I have two tomcat instances on my windows machine and both run the same code and point to the same font directory. Both of these instances use the same Java runtime environment. I get this error with only one of my instances. (I can confirm that the configurations for both are absolutely similar)
Again, as I mentioned already, I did try the Allfonts.jar provided by pd4ml @ http://pd4ml.com/i/allfonts.zip which also generates the same error.
-Regards,
ManoojApril 15, 2015 at 18:52#29703Hmm… As it works on one of the machines, that is obviously not a problem of PD4ML, but a server configuration issue or a JVM installation corruption.
Could you please send us 2 PDF samples produced on the healthy and the problematic machines?
April 16, 2015 at 10:59#29704Well, actually this is how it is,,,
Tomcat instance 1 : I set the font directory as c:windowsfonts to PD4ML and PDF is generated fine. Even the fonts appear fine.
Tomcat instance 2 : I do the same as above, but I get the error in the subject of this discussion.
Now,
Tomcat instance 1 & 2 : I try to load the font files using the jar files PD4ML has provided instead of pointing them to a font directory. I still see the same error.
So, I have a problem with jar way of loading fonts. I can’t seem to get a fonts jar that would work for me.
-Thanks,
ManoojApril 16, 2015 at 11:08#29705Most probably the issue with JAR has a different nature: for example the font .JAR is packed to .WAR, and the web application is not configured to be unpacked to a work directory. In the case PD4ML may have (not in every configuration) fail to load resources from .JAR
But the issue with c:windowsfonts tells that the Tomcat instance #2 has a configuration (or inconsistence) problem. I would start with a resolving the issue.
Enable debug info on both instances and compare PD4ML’s diagnostic output. Is it identical by identical PDF conversion requests (except the failure messages)?
Also requested PDF samples (from even blank HTML) would give us some additional info.
September 7, 2015 at 10:14#29706Can you please emphasize on your point:
“Most probably the issue with JAR has a different nature: for example the font .JAR is packed to .WAR, and the web application is not configured to be unpacked to a work directory. In the case PD4ML may have (not in every configuration) fail to load resources from .JAR”.
-Regards,
ManoojSeptember 7, 2015 at 14:34#29707Ok. so I googled around and having created a temp directory in my tomcat folder cleared the errors with font data not loading and the fonts show up properly.
September 8, 2015 at 16:16#29708Manooj,
glad the issue is solved on your side! -
AuthorPosts
The forum ‘Troubleshooting’ is closed to new topics and replies.