Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #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/<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 file<br /> reject TTF lookup for: 'xxxx proportional unicode bold'<br /> 'times' is not in file<br /> reject TTF lookup for: 'times'<br /> 'times new roman' is not in file<br /> reject TTF lookup for: 'times new roman'<br /> 'akzidenzgroteskbe-bold' is not in 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/";<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, 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 /><br /><br /> document.title=<br /> footer.color=#000000<br /> footer.font.face=Courier New<br /> footer.font.size=10<br /><br /> footer.height=12<br /><br /><br /><br /><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 /><br /> header.height=12<br /><br /><br /><br /><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 /><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 /><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 file is located in the same directory as the fonts and 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,


    Try 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 file (part of the font substitution functionality, I believe).

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

The forum ‘Troubleshooting’ is closed to new topics and replies.