#28465

HTML does not provide fonts. It only refers to fonts, present on a client PC (where a client browser has physical access to the fonts).

In order to add fonts to a PDF document, PD4ML needs an access to font files (to parse the TTFs, extract used glyphs and embed the extracted subset to PDF document).

JVM may use fonts in Java applications, but it offers no access to physical font files. In order to workaround the restriction, you need to accept TTF embedding “complexities”.

First I would recommend to use the standard font dir.
pd4ml.useTTF(“/windows/fonts”, true);
But before you need to index existing fonts with the command line call:
java -jar pd4ml.jar -configure.fonts /windows/fonts

After it works you may create a JAR file with selected fonts. But first make sure the above works.

Also if you want to define document access permissions, you should call setPermissions() method only once:

pd4ml.setPermissions(“empty”, PD4ML.AllowCopy | PD4ML.AllowModify, false);