 |
 |
 |
 |
 |
PDF Generating Tool Support Forum |
 |
|
Topic review - fonts included in the html |
Post subject: Re: fonts included in the html |
You need to pass either a directory name of the font dir pd4ml.useTTF("/windows/fonts",true); or refer to a resource, available via the classloader (distinguished by "java:" prefix) pd4ml.useTTF("java:fonts",true);
In both cases pd4fonts.properties file has to be generated in advance with java -jar pd4ml.jar -configure.fonts ... call.
You need to pass either a directory name of the font dir [b]pd4ml.useTTF("/windows/fonts",true);[/b] or refer to a resource, available via the classloader (distinguished by "java:" prefix) [b]pd4ml.useTTF("java:fonts",true);[/b]
In both cases [b]pd4fonts.properties[/b] file has to be generated in advance with [b]java -jar pd4ml.jar -configure.fonts ...[/b] call.
|
|
|
PD4ML
 |
Posted: 22 Mar 2011, 16:00 |
|
|
|
 |
Post subject: Re: fonts included in the html |
thank you so if i do as you say any html tag that contains a font attribute with specific font will be interrepted with the appropriate font that i have just embadded and no need to add any additional code i just need say pd4ml.usttf("windows:fonts",true);
thank you
thank you so if i do as you say any html tag that contains a font attribute with specific font will be interrepted with the appropriate font that i have just embadded and no need to add any additional code i just need say pd4ml.usttf("windows:fonts",true);
thank you
|
|
|
anas_srairah
 |
Posted: 21 Mar 2011, 22:00 |
|
|
|
 |
Post subject: Re: fonts included in the html |
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);
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. [b]pd4ml.useTTF("/windows/fonts", true);[/b] But before you need to index existing fonts with the command line call: [b]java -jar pd4ml.jar -configure.fonts /windows/fonts[/b]
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 [b]setPermissions()[/b] method only once:
[b]pd4ml.setPermissions("empty", PD4ML.AllowCopy | PD4ML.AllowModify, false);[/b]
|
|
|
PD4ML
 |
Posted: 21 Mar 2011, 16:09 |
|
|
|
 |
Post subject: fonts included in the html |
hi i am using TTF embadding in pro edition to include arabic support , any way how can i make my html to pdf converter work based on the fonts that are provided by the html , i need to get this in my head because i have used the steps you specify for the TTF embadding and its not working .
pd4ml.useTTF("java:fonts", true); //pd4ml.useTTF("/windows/fonts", true); pd4ml.setPermissions("empty", PD4ML.AllowCopy, false); pd4ml.setPermissions("empty", PD4ML.AllowModify, false); pd4ml.setHtmlWidth(userSpaceWidth); pd4ml.setPageSize(format); pd4ml.adjustHtmlWidth();
pd4ml.render(url, fos);
thanks
hi i am using TTF embadding in pro edition to include arabic support , any way how can i make my html to pdf converter work based on the fonts that are provided by the html , i need to get this in my head because i have used the steps you specify for the TTF embadding and its not working .
pd4ml.useTTF("java:fonts", true); //pd4ml.useTTF("/windows/fonts", true); pd4ml.setPermissions("empty", PD4ML.AllowCopy, false); pd4ml.setPermissions("empty", PD4ML.AllowModify, false); pd4ml.setHtmlWidth(userSpaceWidth); pd4ml.setPageSize(format); pd4ml.adjustHtmlWidth();
pd4ml.render(url, fos);
thanks
|
|
|
anas_srairah
 |
Posted: 21 Mar 2011, 12:05 |
|
|
|
 |
|

|
 |
 |
|
 |
Copyright ©2004-10 zefer|org. All rights reserved. |
|
|
 |
|
 |