1

I'm using Zend Framework 1.12 along with DOMPDF 0.6.0 beta 3. I'm trying to render a text in Romanian containing special characters (ăîâşţ ĂÎÂŞŢ).

Here is my code:

    $this->_helper->viewRenderer->setNoRender();
    $this->view->layout()->disableLayout();

    require_once 'dompdf_config.inc.php';  
    $autoloader = Zend_Loader_Autoloader::getInstance(); // assuming we're in a controller  
    $autoloader->pushAutoloader('DOMPDF_autoload');

    $html = 'test ăîâşţ ĂÎÂŞŢ';

    $dompdf = new DOMPDF();  
    $dompdf->set_paper("a4","portrait");  
    $dompdf->load_html($html);  
    $dompdf->set_base_path($_SERVER['DOCUMENT_ROOT']);  
    $dompdf->render();  
    $dompdf->stream("domAction.pdf");
    exit();

However, this is what the PDF file displays: test ăîâşţ ĂÎÂŞŢ

I'm sure it's got something to do with the Zend Autoloader, since DOMPDF is able to create a .pdf file containing those special characters when using it in a simple example (without Zend Framework).

Any suggestions or solutions?

Daniel
  • 667
  • 6
  • 19
  • Hard to see where Zend is affecting you here, maybe in the default character encoding. However, check out the [Unicode How-To](https://github.com/dompdf/dompdf/wiki/UnicodeHowTo) since it may just be a matter of your HTML document's structure. – BrianS Mar 13 '13 at 15:14

0 Answers0