0

I am using 0.7.0 dompdf to generate pdf file from html. I can create pdf file but it doesnt show Turkish Characters. Here are my codes:

PHP code to generate pdf by using dompdf:

    use Dompdf\Dompdf;
    use Dompdf\Options;

    $pdfresult=$gotoclass->generatepdf();

    setlocale(LC_ALL, 'en_US.UTF-8');

    require_once '../../include/dompdf/autoload.inc.php';

    $options = new Options();
    $options->set('defaultFont', 'Courier');
    $dompdf = new Dompdf($options);

    $dompdf->loadHtml("$pdfresult");

    $dompdf->setPaper('A4', 'landscape');

    $dompdf->render();

    $dompdf->stream();

    unset($pdfresult);
    unset($dompdf);

if I delete setlocale(LC_ALL, 'en_US.UTF-8'); part from code then it gives following IteratorAggregate error:

Fatal error: Interface 'IteratorAggregate' not found in /public_html/include/dompdf/src/Frame/FrameTreeList.php on line 14

How can I fix this problem and show Turkish characters in pdf? Appreciate for your helps!

kazata
  • 71
  • 2
  • 2
  • 10
  • The FrameTree iterator issue seems to be a separate issue from your character display problems that might need to be addressed by the Dompdf team. – BrianS Jan 18 '17 at 18:08
  • Possible duplicate of [dompdf character encoding UTF-8](http://stackoverflow.com/questions/16384517/dompdf-character-encoding-utf-8) – BrianS Jan 18 '17 at 18:13
  • Possibly related issue: https://github.com/dompdf/dompdf/issues/1355 – BrianS Jan 21 '17 at 02:34

0 Answers0