Hello everyone and welcome, sorry about my english not my main language. I'm a beginner on Zend Framework 2 also. I got an issue with DOMPDF in ZF2, when i try to show an image in my web page (virtualhost with apache2, the folder in desktop). For example:
<img src="/home/luifer/logo_uca.png" alt="logo_uca" />
With the error:
[Sun May 18 12:28:45.023452 2014] [:error] [pid 7195] [client 127.0.0.1:57089] PHP Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent found. Not good.' in /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/inline_positioner.cls.php:37 Stack trace: #0 /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/frame_decorator.cls.php(700): Inline_Positioner->position() #1 /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/inline_frame_reflower.cls.php(36): Frame_Decorator->position() #2 /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/frame_decorator.cls.php(711): Inline_Frame_Reflower->reflow(NULL) #3 /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/page_frame_reflower.cls.php(123): Frame_Decorator->reflow() #4 /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/frame_decorator.cls.php(711): Page_Frame_Reflower->reflow(NULL) #5 /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/dompdf.cls.php(949): Frame_Decorator->reflow() #6 /home/luifer/Desktop/zf2-tutorial/vendor/dino/dompdf-module/src/ in /home/luifer/Desktop/zf2-tutorial/vendor/dompdf/dompdf/include/inline_positioner.cls.php on line 37
When i open the same page on the browser manually (right click open page with browser) the image shows in the page.
Just in case, my controller function:
public function extraordinarioAction()
{
//quitar de la bd
$pdf = new PdfModel();
return $pdf;
}
And my view page is extraordinario.phtml with a html page on it. I tried a simple page with a loading image and nothing shows, just a blank page with this error.
Anyone knows how to solve this problem? I already did some things like enabling the mbstring.
Any ideas? And thanks in advance.