dimanche 22 septembre 2019

How to make DOMPDF support unicode?

I'm using Laravel 5.8 with DOMPDF its work fine for English but not working for Unicode it's always output ???? symbol to me.

Code:

function pdf()
{
    $pdf = \App::make('dompdf.wrapper');
    $pdf->loadHTML($this->convert_reports_to_html());
    return $pdf->stream();

}

function convert_reports_to_html()
{
    $reports = $this->get_reports();
    $output = '
 <h3 align="center">Customer Data</h3>
 <table width="100%" style="border-collapse: collapse; border: 0px;">
  <tr>
    <th style="border: 1px solid; padding:12px; " width="20%">Quarter</th>
    <th style="border: 1px solid; padding:12px;" width="30%">Targat</th>
   </tr>';
    foreach($reports as $report)
    {
        $output .= '
  <tr>
   <td style="border: 1px solid; padding:12px; font-family: sans-serif; ">'.$report->select_qur.'</td>
   <td style="border: 1px solid; padding:12px;">'.$report->target_value.'</td>

  </tr>
  ';
    }
    $output .= '</table>';
    return $output;
}

Result ?????????



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire