Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #26232

    We are using pd4ml.useTTF( fontsDir, true ); in the java class, we are also including ‘‘ in the top of our HTML, and yet it does not seem to be including our custom TTF.

    Do you have any tips for debugging this? or what else we should look for?



    The debug tactics is quite simple: switch debug output on with pd4ml.enableDebugInfo() and check what it dumps to STDOUT. It should be traces that it successfully loaded (by the way, did you generated the file as required?) and the referenced font files.

    TTF embedding feature has one requirements to TTF file format: the custom TTFs must be UNICODE-compatible (as almost any modern TTF font).

    If for some reasons it rejects your TTFs, you may play with TTF file format using free FontForge utility (you may change TTF file options in “Save TTF” dialog). It is built for UNIX/Linux platform, but also runs on Win32 in Cygwin environment. Just google for a preconfigured FontForge + Cygwin with the following keyword: “fontforge-mingw_2008_11_21


    When we use the command line to generate the file it returns a file instead. So we copied an example fonts properties file and changed it as per our font files and names.

    Here is what we typed from the command line…

    java -jar pd4ml.jar -configure.fonts /path/to/my/fonts/

    and that spits out a file.

    Here’s a copy of our simple file…

    #this is an autogenerated file. please remove manually any references to copyrighted fonts
    #Wed Sep 13 13:59:25 CEST 2006
    Comic Sans MS=Comic Sans MS.ttf

    We haven’t tried the debug option yet, I figured I’d post this information first. I will try and see what the debug spits out in a bit. If there’s anything that jumps out that’s incorrect here that might save me some time.


    Thanks for the help, we managed to get it working.

    We still don’t know why the command to generate the file wasn’t working. We had an issue with that file and once we fixed it the loading of the fonts worked.

    Thank you for the suggestion of the debugging, that’s what lead us to find the error.



    @koda-dev wrote:

    When we use the command line to generate the file it returns a file instead.

    During the first run of PD4Browser (java -jar pd4ml(_demo).jar) in any mode, it generates default application properties file

    You run PD4Browser the first time to generate TTF properties. So it produces two .properties files. One is in the current directory (./, another one is in the font files directory (/path/to/my/fonts/

    The fact of two simultaneous .properties files output may be confusing. Also if you generate the properties file for c:windowsfonts, the resulting file exists, but it is not visible with windows explorer (in the folder the explorer in the fonts-only view mode). But the file may be easily opened with any text editor, for instance.

    Obviously we need to clarify the topics more detailed in the documentation.


    on Win8.1 in cmd:
    I:xampphtdocspd4mlprobe>java -Xmx512m -Djava.awt.headless=true -cp I:xampphtdocspd4mlpd4ml_demo.jar Pd4Cmd "file:123.html" -ttf I:xampphtdocspd4mlfonts 800 A4 -debug -out pd4ml.pdf<br /> version: PD4ML 385fx6 Pro (eval)<br /> not yet in cache: file:I:xampphtdocspd4mlfonts/<br /> 'times' is not in file<br /> reject TTF lookup for: 'times'<br /> not yet in cache: file:I:xampphtdocspd4mlfonts/times.ttf<br /> read 'times new roman' from file:I:xampphtdocspd4mlfonts/times.ttf<br /> 'times bold' is not in file<br /> reject TTF lookup for: 'times bold'<br /> not yet in cache: file:I:xampphtdocspd4mlfonts/timesbd.ttf<br /> read 'times new roman bold' from file:I:xampphtdocspd4mlfonts/timesbd.ttf<br /> ...

    is the right path in windows system?


    Please share the file example. In my case also it is not generated file. Instead of generating it gives UI called PD4ML Converter. Please help me to generate the and while mean pls share the working file. Then i can manually create it and place it in font folder.


    A usual reason, that it does not generate is insufficient permissions.

    For example the command has to index all system font and to generate c:/windows/fonts/ :

    java -jar pd4ml.jar -configure.fonts c:/windows/fonts

    but it does not, as by default (in modern Win versions) it has no permissions to write to c:/windows/fonts

    A solution is to generate the properties file somewhere else:

    java -jar pd4ml.jar -configure.fonts c:/windows/fonts c:/workspace/fontmap/

    The second parameter defined a destination folder or new file name for generated The .properties will refer to c:/windows/fonts as the actual TTF location.

    In your application pass “c:/workspace/fontmap/” as useTTF() parameter.

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

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.