laravel 5.2 - ErrorException in class.pdf.php line 3154 -


i'm new in laravel, use laravel 5.2 , i'm trying generate report using dompdf i'm getting error:

errorexception in class.pdf.php line 3154

undefined index:

in class.pdf.php line 3154 @ handleexceptions->handleerror('8', 'undefined index: ', 'c:\xampp\htdocs\balai\vendor\dompdf\dompdf\lib\class.pdf.php', '3154', array('size' => '12')) in class.pdf.php line 3154 @ cpdf->getfontheight('12') in cpdf_adapter.cls.php line 740 @ cpdf_adapter->get_font_height('c:/xampp/htdocs/balai/vendor/dompdf/dompdf/lib/fonts/times-roman', '12') in font_metrics.cls.php line 122 @ font_metrics::get_font_height('c:/xampp/htdocs/balai/vendor/dompdf/dompdf/lib/fonts/times-roman', '12') in text_frame_reflower.cls.php line 167 @ text_frame_reflower->_layout_line() in text_frame_reflower.cls.php line 332 @ text_frame_reflower->reflow(object(block_frame_decorator)) in frame_decorator.cls.php line 711 @ frame_decorator->reflow(object(block_frame_decorator)) in block_frame_reflower.cls.php line 750 @ block_frame_reflower->reflow(null) in frame_decorator.cls.php line 711 @ frame_decorator->reflow() in page_frame_reflower.cls.php line 123 @ page_frame_reflower->reflow(null) in frame_decorator.cls.php line 711 @ frame_decorator->reflow() in dompdf.cls.php line 973 @ dompdf->render() in pdf.php line 208 @ pdf->render() in pdf.php line 154 @ pdf->output() in pdf.php line 166 @ pdf->save('documents.pdf') in llajrambucontroller.php line 247 @ llajrambucontroller->printrambu('52', '1') 

i having same problem, , found solution makes no sense me.

the html passing dompdf didn't have line breaks, like:

<html><body>content here<body></html> 

adding break after body tag fixed problem.

<html><body> content here </body></html> 

no clue what's going on, works. hope fixes problem too.


Comments

  1. Por si le sirve a alguien, tuve el mismo problema, en un proyecto funcionaba bien, pero en otro no, y al comparar los directorios fonts del dompdf pude ver que no tenĂ­an la misma cantidad de archivos por lo que copie manualmente todos los archivos font de un directorio a otro y ahi funciono correctamente, la via es

    C:\xampp\htdocs\miproyecto\vendor\dompdf\dompdf\lib\fonts

    Espero les sirva

    ReplyDelete

Post a Comment

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -