HTML to PDF / DOCX / RTF Java converter library Forums PD4ML Forums Technical questions / Troubleshooting How to check when there is no temp folder to use the font cache ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33949

    I created a pdf.
    But I found out that the fonts were broken.
    The cause was missing temp folder in tomcat was.
    If the font is not loaded, we would like to process an exception to prevent pdf generation.

    To sum up
    Read the font to generate a pdf.
    I wnat to check if there is no temp folder for reading font
    or if I don’t have the right to read temp folder.

    Attachments:
    You must be logged in to view attached files.
    #33953

    You can determine the actual temp dir location by an inspecting of the system property System.getProperty("java.io.tmpdir");. Also you may override the property with JVM command-line parameter.

    However in your particular case the problem reason seems to be other: try to explicitly define the document encoding. Now your on screenshots it looks like a two-bytes encoding is treated as a default single byte encoding (ISO-8859-1) – that causes the garbage texts in the output.

    #33962

    I tested it when there was and when there was no temp folder.
    If there is no temp folder, pd4ml cannot read font. If there is a temp folder, read font normally.
    Can you confirm the failure to read the font with api?

    #33963

    The temp dir is needed not by PD4ML itself, but by the font subsystem of JVM.

    java.awt.Font.createFont() creates java.awt.Font instance from a given byte array, but as a rule (obviously it is platform-dependent) it needs to create a corresponding font file in the temp dir. We cannot control the internal java.awt.Font.createFont() logic, it is only possible to re-define temp dir location with java.io.tmpdir system property.

    #33964

    I understand your answer.
    Thank you very much for your reply.

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

You must be logged in to reply to this topic.