mpdf / mpdf

PHP library generating PDF files from UTF-8 encoded HTML
https://mpdf.github.io
GNU General Public License v2.0
4.37k stars 1.06k forks source link

Unable to write द्वितीय in PDF #1882

Open ccpplinux opened 1 year ago

ccpplinux commented 1 year ago

Guidelines

Description of the bug

I am unable to write the hindi word द्वितीय in the PDF file generated by mpdf. When I am trying to display द्वितीय then it is being displayed as दिवतीय in the PDF file. So can any one help me to fix this issue so that I can correctly display the hindi word द्वितीय in the PDF file.

mPDF version

8.1.0

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

7.4

Reproducible PHP+CSS+HTML snippet suffering by the error

Below

ccpplinux commented 1 year ago

Here is the minimal code:

require_once __DIR__ . '/mpdf/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->autoScriptToLang = true;
$mpdf->baseScript = 1;
$mpdf->autoVietnamese = true;
$mpdf->autoArabic = true;
$mpdf->autoLangToFont = true;

$html=
"
<html>
    <head>
        <style>
            body { font-family: sans; text-align: justify; }
            p { font-family: sans; }
            div { font-family: sans; }
            h1 { font-family: sans; }
            td { font-family: sans; }
        </style>
    </head>
    <body>
        Result is द्वितीय
    </body>
</html>
";
$mpdf->WriteHTML($html);
$mpdf->Output();
?>
KunalGautam commented 1 year ago

Reference to #1277