如何在FPDF中将英语转换为阿拉伯语文本

时间:2015-12-17 07:14:33

标签: php fpdf

我正在使用FPDF api获取pdf文档,但我使用html格式的英文文本来创建pdf是否有可能在fpdf中将英语单词转换为阿拉伯语我试过但我无法得到它?任何帮助将受到高度赞赏

这是我的代码

<?php

$pdf=new PDF_HTML();

$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);

$pdf->AddPage();
$pdf->SetFont('Arial','B',14);
$pdf->WriteHTML('<para><h1>Created By test Developer</h1><br>
');

$pdf->SetFont('Arial','B',7); 
$htmlTable='
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" dir="rtl">

<body>
<div class="trn">
<p>The Client</p>

<p>&nbsp;</p>

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
    <tbody>
        <tr>
            <td>name1</td>
            <td>name2</td>
        </tr>
        <tr>
            <td>
            <table border="1" cellpadding="1" cellspacing="1" style="width:500px">
                <tbody>
                    <tr>
                        <td>>&#1576;&#1610;&#1587;&#1578;</td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            </td>
            <td>
            <table border="1" cellpadding="1" cellspacing="1" style="width:500px">
                <tbody>
                    <tr>
                        <td>name1</td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
        <tr>
            <td>
            <table border="1" cellpadding="1" cellspacing="1" style="width:500px">
                <tbody>
                    <tr>
                        <td>name1</td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            </td>
            <td>
            <table border="1" cellpadding="1" cellspacing="1" style="width:500px">
                <tbody>
                    <tr>
                        <td>name1</td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>

<p>&nbsp;</p>

<p>Your Faithfully,</p>

</div></body></html>
        ';
$pdf->WriteHTML2("<br><br><br>$htmlTable");
$pdf->SetFont('Arial','B',6);

如需更多代码,请访问http://codepad.viper-7.com/C1NSqR

0 个答案:

没有答案