HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › Does Not Find New Fonts
- This topic has 1 reply, 2 voices, and was last updated Aug 29, 2010
11:22:01 by Anonymous.
-
AuthorPosts
-
March 24, 2010 at 16:19#26355
I am trying to render an HTML document with Chinese characters into a PDF and it either inserts ??? for the missing characters or it totally ignores them.
In my logs I see this:
<br /> ENCODING=UTF8<br /> version: PD4ML 351 Pro<br /> not yet in cache: file:C:DEVworkspaceECLIPSEportalweb-colotargetworkwebappWEB-INFclassescomxxxxxxxxportalrenderdocument/pd4fonts.properties<br /> not yet in cache: file:C:DEVworkspaceECLIPSEportalweb-colotargetworkwebappWEB-INFclassescomxxxxxxxportalrenderdocument/xxxx-propu.ttf<br /> read 'xxxx proportional unicode' from file:C:DEVworkspaceECLIPSEportalweb-colotargetworkwebappWEB-INFclassescomxxxxxxxxportalrenderdocument/xxxx-propu.ttf<br /> 'xxxx proportional unicode bold' is not in pd4fonts.properties file<br /> reject TTF lookup for: 'xxxx proportional unicode bold'<br /> 'times' is not in pd4fonts.properties file<br /> reject TTF lookup for: 'times'<br /> 'times new roman' is not in pd4fonts.properties file<br /> reject TTF lookup for: 'times new roman'<br /> 'akzidenzgroteskbe-bold' is not in pd4fonts.properties file<br /> reject TTF lookup for: 'akzidenzgroteskbe-bold'<br /> done in 500ms.<br />
This is the code that I believe is relevant:
<br /> String pathToPd4fontsProps = "/com/xxxx/xxxx/portal/render/document/pd4fonts.properties";<br /> URL fontPathURL = PD4MLDocumentRenderer.class.getResource( pathToPd4fontsProps );<br /> File fileP = new File(fontPathURL.toURI());<br /> fontPath = fileP.getParent();<br />
Later on in the same method I have this code:
<br /> pd4ml.enableDebugInfo();<br /> pd4ml.useTTF( fontPath, true );<br />
I followed the documents on this site to generate my pd4browser.properties, which is located in the same directory as the fonts and contains the following:
<br /> #<br /> #Wed Mar 24 07:21:32 EDT 2010<br /> adobe.font.metrics=true<br /> debug.info.enable=false<br /> document.author=<br /> document.title=<br /> footer.color=#000000<br /> footer.font.face=Courier New<br /> footer.font.size=10<br /> footer.font.style=0<br /> footer.height=12<br /> footer.init.page.num=1<br /> footer.page.num.align=right<br /> footer.page.num.template=null<br /> footer.pages.to.skip=0<br /> footer.title.align=center<br /> footer.title.template=null<br /> header.color=#000000<br /> header.font.face=Courier New<br /> header.font.size=10<br /> header.font.style=0<br /> header.height=12<br /> header.init.page.num=1<br /> header.page.num.align=right<br /> header.page.num.template=null<br /> header.pages.to.skip=0<br /> header.title.align=center<br /> header.title.template=null<br /> images.interpolate=false<br /> insets.bottom=10<br /> insets.left=10<br /> insets.right=10<br /> insets.top=10<br /> insets.units=mm<br /> page.bookmarks.destinations=false<br /> page.bookmarks.headings=false<br /> page.format=A4<br /> page.hyperlinks=true<br /> page.orientation=false<br /> pdf.forms.enable=false<br /> proxy.host=<br /> proxy.port=0<br /> rendering.patch=true<br /> rendering.split=true<br /> table.breaks.enable=false<br /> ttf.fonts.default.monospace=<br /> ttf.fonts.default.sansserif=<br /> ttf.fonts.default.serif=<br /> ttf.fonts.dir=com/xxxx/xxxx/portal/render/document<br /> userSpace.adjustToContent=false<br /> userSpace.width=800<br /> viewer.executeble=acroread.exe<br /> viewer.params=<br /> window.height=100<br /> window.width=100<br /> window.x=850<br /> window.y=600<br />
Finally, my pd4fonts.properties file is located in the same directory as the fonts and pd4browser.properties and it contains the following:
<br /> #this is an autogenerated file. please remove manually any references to copyrighted fonts<br /> #Wed Mar 24 07:21:32 EDT 2010<br /> KaiTi_GB2312=SIMKAI.TTF<br /> xxxx Fixed 2 Unicode=xxxx-fixed2U.ttf<br /> xxxx Fixed Unicode=xxxx-fixedu.ttf<br /> xxxx Fixed Unicode B=xxxx-FixedU_B.ttf<br /> xxxx Fixed Unicode C=xxxx-FixedU_C.ttf<br /> xxxx Fixed Unicode D=xxxx-FixedU_D.ttf<br /> xxxx Fixed Unicode F=xxxx-FixedU_F.ttf<br /> xxxx Prop Unicode B=xxxx-PropU_B.ttf<br /> xxxx Prop Unicode C=xxxx-PropU_C.ttf<br /> xxxx Prop Unicode D=xxxx-PropU_D.ttf<br /> xxxx Prop Unicode F=xxxx-PropU_F.ttf<br /> xxxx Proportional Unicode=xxxx-propu.ttf<br />
You see that I have a mention of the Chinese font “KaiTi_GB2312=SIMKAI.TTF” but obviously it never is even mentioned. What am I doing wrong?
My PDFs do get rendered but either with question marks or with the Chinese characters totally omitted. Please help.Thank you,
TyAugust 29, 2010 at 11:22#27926Try turning on PD4ML debugging and you should be able to see the TTFs loading in the logs. To see the debugging, you may need to restart your application server. There are some default CSS styles like “simsum” for Chinese that you could map in your pd4fonts.properties file (part of the font substitution functionality, I believe).
-
AuthorPosts
The forum ‘Troubleshooting’ is closed to new topics and replies.