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

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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.html

    Can you please help resolve this issue?

    -Regards,
    Manooj

    #29701

    The 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?

    See http://pd4ml.com/html-to-pdf-command-line-tool.htm

    #29702

    I 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,
    Manooj

    #29703

    Hmm… 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?

    #29704

    Well, 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,
    Manooj

    #29705

    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

    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.

    #29706

    Can 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,
    Manooj

    #29707

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

    #29708

    Manooj,
    glad the issue is solved on your side!

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.