title: Arabic language not working on pdf export using dompdf, while its working fine with excel in laravel
body: <blockquote>
    <p>This is my controller stockcontroller.php, using for export data</p>
  </blockquote>
  
  <pre><code>public function exportStock(Request $request)
      {
          header('http-equiv : Content-Type; Content-Type: text/html; charset=utf-8');
          if($request-&gt;status=='show')
          {
              $su=stock::where('is_active',1);
          }
          elseif ($request-&gt;status=='hide')
          {
              $su=stock::where('is_active',0);
          }
          else{
              $su=stock::where('is_active','!=',2);
          }
  
  
          $su=$su-&gt;get();
  $exp=$request-&gt;exp;
  
          if($exp=='Export to Excel') {
              $exp = 'XLS';
              Excel::create('Export Data', function ($excel) use ($su) {
                  $excel-&gt;sheet('sheet 1', function ($sheet) use ($su) {
                      $sheet-&gt;appendRow(['S.No.', 'Stock Name(En)', 'Stock Name(Ar)', 'Users participated', 'Quantity', 'Status']);
                      $sn = 1;
                      foreach ($su as $p) {
                          if ($p-&gt;userQuantity()-&gt;first()) {
                              $temp = $p-&gt;userQuantity()-&gt;sum('quantity');
                          } else {
                              $temp = '';
                          }
  
                          if ($p-&gt;userStocks()-&gt;first()) {
                              $temp2 = $p-&gt;userStocks()-&gt;count();
                          } else {
                              $temp2 = '';
                          }
  
                          if ($p-&gt;is_active == '1') {
                              $st = 'Show';
                          } elseif ($p-&gt;is_active == '0') {
                              $st = 'Hide';
                          }
  
                          $sheet-&gt;appendRow([$sn, $p-&gt;name_en, $p-&gt;name_ar, $temp, $temp2, $st]);
                          $sn++;
                      }
                  });
              })-&gt;download($exp);
              return redirect('admin/stock');
          }
          if($exp=='Export to PDF'){$exp='PDF';
  
              include ('dompdf/autoload.inc.php');
  
  
  // instantiate and use the dompdf class
              $var="&lt;table&gt;&lt;tr&gt;&lt;th&gt;S.No.&lt;/th&gt;&lt;th&gt;Stock Name(En)&lt;/th&gt;&lt;th&gt;Stock Name(Ar)&lt;/th&gt;&lt;th&gt;Users participated&lt;/th&gt;&lt;th&gt;Quantity&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;/tr&gt;";
              $tt=1;
              foreach ($su as $dd) {
                  if ($dd-&gt;userQuantity()-&gt;first()) {
                      $temp = $dd-&gt;userQuantity()-&gt;sum('quantity');
                  } else {
                      $temp = '';
                  }
  
                  if ($dd-&gt;userStocks()-&gt;first()) {
                      $temp2 = $dd-&gt;userStocks()-&gt;count();
                  } else {
                      $temp2 = '';
                  }
  
                  if ($dd-&gt;is_active == '1') {
                      $st = 'Show';
                  } elseif ($dd-&gt;is_active == '0') {
                      $st = 'Hide';
                  }
                  $var .= "&lt;tr&gt;&lt;td&gt;$tt&lt;/td&gt;&lt;td&gt;$dd-&gt;name_en&lt;/td&gt;&lt;td&gt;$dd-&gt;name_ar&lt;/td&gt;&lt;td&gt;$temp&lt;/td&gt;&lt;td&gt;$temp2&lt;/td&gt;&lt;td&gt;$st&lt;/td&gt;&lt;/tr&gt;";
                  $tt++;
              }
              $var.="&lt;/table&gt;";
              $dompdf = new Dompdf();
              $dompdf-&gt;loadHtml($var);
  
  // (Optional) Setup the paper size and orientation
              $dompdf-&gt;setPaper('A4', 'landscape');
  
  // Render the HTML as PDF
              $dompdf-&gt;render();
  
  // Output the generated PDF to Browser
              $dompdf-&gt;stream();
          }
      }
  </code></pre>
  
  <blockquote>
    <p>Excel is working fine while PDF is not supporting Arabic content it
    shows ????? like symbols in place of Arabic language.  Note :
    Previously I was using same code for pdf and excel there was the same
    issue. So I try to make it separate from excel</p>
  </blockquote>