Viewing 1 post (of 1 total)
  • Author
    Posts
  • #27085

    I can not parse thai font with taglib but on pd4ml.render() is worked.

    I have a license of pd4ml and waiting for your answer since last friday(24.06.16).

    So that I think I should ask on this forum better.

    ======== my code ===========
    Dear PD4ML Team

    I have coded program with jsp language and found this code could not show the right character.
    So that I would like to ask how I code the right way?

    By the way, when I coded with java below it shows right font.

    [
    File tempFile = File.createTempFile( "pd4ml", ".pdf" );
    java.io.FileOutputStream fos = new java.io.FileOutputStream( tempFile );
    
    PD4ML pd4ml = new PD4ML();
    pd4ml.setHtmlWidth( 800 );
    pd4ml.useAdobeFontMetrics(true);
    pd4ml.useTTF( "/Volumes/Macintosh HD BK/project/convertpdf/fonts", true );
    pd4ml.render( "http://www.xxxxxx.com/view?date=16/06/2016");
    ]

    For JSP I follow these step below

    1. First step: This is file jsp

    <%@ taglib uri="/pd4ml" prefix="pd4ml" %><%@page contentType="text/html; charset=UTF-8"%><%String aim="Aimmy ศาธิญา";%>
    <%=aim %>
    <pd4ml:transform screenWidth="400"
    fileName="myreport.pdf"
    encoding="UTF-8"
    pageFormat="A5"
    inline="true"
    pageOrientation="landscape"
    encoding="default"
    pageInsets="100,100,100,100,points">
    <pd4ml:header
    
    titleTemplate="$[title]"
    
    pageNumberTemplate="page $[page]"
    
    titleAlignment="left"
    
    pageNumberAlignment="right"
    
    color="#008000"
    
    initialPageNumber="1"
    
    pagesToSkip="1"
    
    fontSize="14"
    
    areaHeight="18"/>
    
    <pd4ml:usettf from="/Volumes/Macintosh HD BK/project/convertpdf/fonts"  embed="true" serif="true"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    1.Hello <%=aim %>
    <br>
    <font face="SukhumvitBold" size="+3">
    2.Hello, New Page!  สวัสดี</font><br>
    <font face="KaiTi_GB2312">
    3.Hello, New Page!  สวัสดีจ้า</font><br>
    <font face="Tahoma">
    4.Hello, New Page!  สวัสดีจ้า</font><br>
    <font face="Arial">
    5.Hello, New Page!  สวัสดีจ้า</font>
    <table border="1" bordercolor="red" width="50%">
    <tr>
    <td>ก</td><td>ข</td>
    </tr>
    <tr>
    <td>ค</td><td>ง</td>
    </tr>
    </table>
    </body>
    </html>
    </pd4ml:transform>

    Step 2 and 5 is in attached file
    2. [attachment=1:zlpdssy9]Screen Shot 2559-06-24 at 3.04.51 PM.png[/attachment:zlpdssy9]

    3. Third step: This is file pd4fonts.properties

    KaiTi_GB2312=SIMKAI.TTF
    AngsanaUPC=AngsaUPC.TTF
    Arial=Arial.ttf
    Arial Italic=ArialItalic.ttf
    Arial Bold=ArialBold.ttf
    Arial Bold Italic=ArialBoldItalic.ttf
    Tahoma=Tahoma.ttf
    Tahoma Bold=Tahoma Bold.ttf
    SukhumvitRegular=sukhumvitreg-webfont.ttf
    SukhumvitBold=sukhumvitbold-webfont.ttf

    4. Fourth step: web.xml

    <web-app>
    <jsp-config>
    <taglib>
    <taglib-uri>/pd4ml</taglib-uri>
    <taglib-location>/WEB-INF/tlds/pd4ml.tld</taglib-location>
    </taglib>
    </jsp-config>
    </web-app>

    5.[attachment=0:zlpdssy9]Screen Shot 2559-06-24 at 3.10.14 PM.png[/attachment:zlpdssy9]

    ========end my code =========

    Thank you.

Viewing 1 post (of 1 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.