PDF Generating Tool Support Forum

HOME   Login   Register    Search




Post a reply
Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are OFF
Disable BBCode
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the Board Administrator.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

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.
    Post 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
    Post 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);
    Post 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
    Post Posted: 21 Mar 2011, 12:05
 


cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share