setLanguageArray($lg); // --------------------------------------------------------- // set font $pdf->SetFont('freesans', '', 12); // add a page $pdf->AddPage(); // Hindi content $htmlhindi = 'नमस्ते आप कैसे हैं'; $pdf->WriteHTML($htmlhindi, true, 0, true, 0); // --------------------------------------------------------- //Close and output PDF document $pdf->Output('example_018.pdf', 'I');