Hi,
im new with dompdf. I'm using it in a cakephp project to generate and
download a pdf file from an html string that i read from an html file.
Im using dompdf 0-6-0-beta1.
Now the problem is that everything works fine in my localhost (xampp),
the pdf is rendered and generetad perfectly, but when i upload the
same code (no changes) it to the server it stops working.
Im wasting my days trying to find out whats happening so im looking
for some help here. I have tried re-uploading a new copy of dompdf,
and also checking and rechecking all the permissions. I have also
checked the html/css and it is ok (not broken)
So im just wondering if there are any external dependecies or php
modules that i need to enable on my server that makes dompdf
crashes??
Here is my html string, php code to generate the pdf and the errors im
getting:
HTML STRING:
---------------------------------------------------------------------------------------------------------------------------
<style type="text/css"> #cv-container { font-size: 12px; } .left-td
{ margin:0px; border-right: 1px solid grey; text-align: right; padding:
3px; width:200px; padding-right:10px; } .right-td { margin:0px; width:
600px; text-align: left; padding:3px; padding-left: 10px; } .bold-td
{ font-weight: bold; font-size: 16px; padding-top: 10px; padding-
bottom: 10px; } .lang-bold-td { font-weight: bold; font-size:
16px; } .head-td { padding-top:20px; padding-bottom:20px; font-size:
18px; } .lang-right,.lang-head,.lang-value { margin:0px; width:110px;
text-align: left; padding:3px; padding-left: 10px; } .lang-head { font-
weight: bold; } .lang-value { font-family: cursive; } #lang-
table,#skills-table { margin:0px; padding:0px; } .img-td { width:
105px; border-bottom: 1px solid grey; } </style> <div id="cv-
container"> <table id="cv-table" cellspacing="0px"> <tr> <td
class="img-td" ><img src="
http://localhost/cv/img/europass.jpg"
height="80px" width="100px" alt="" /></td><td class="right-td"
style=""></td> </tr> <tr> <td class="left-td bold-td head-
td">Curriculum Vitae Europass</td> <td class="right-td" > </td> </tr>
<tr> <td class="left-td bold-td" >Informacione Personale</td><td
class="right-td" ></td> </tr> <tr> <td class="left-td bold-td">Emri/
Mbiemri</td><td class="right-td bold-td">name surname</td> </tr><tr>
<td class="left-td">Adresa</td><td class="right-td">address</td> </
tr><tr> <td class="left-td">Datelindja</td><td class="right-
td">02-05-2010</td> </tr> </table> </div>
PHP CODE
----------------------------------------------------------------------------------------------------------------------------------
$handle = fopen($myFile, "r");
$html = fread($handle, filesize($myFile));
fclose($handle);
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("mycv.pdf");
ERRORS STACK TRACE
--------------------------------------------------------------------------------------------------------------------------------------
Notice (8): Undefined variable: data [APP/vendors/dompdf/include/
functions.inc.php, line 344]
Code | Context
$str = "inherit"
$encoding = "iso-8859-1"
return strlen(utf8_encode($data));
} else {
return strlen(utf8_decode($data));
mb_strlen - APP/vendors/dompdf/include/functions.inc.php, line 344
CSS_Color::parse() - APP/vendors/dompdf/include/css_color.cls.php,
line 207
Style::munge_color() - APP/vendors/dompdf/include/style.cls.php, line
737
Style::set_background() - APP/vendors/dompdf/include/style.cls.php,
line 1578
Style::__set() - APP/vendors/dompdf/include/style.cls.php, line 800
Stylesheet::_parse_properties() - APP/vendors/dompdf/include/
stylesheet.cls.php, line 1010
Stylesheet::_parse_sections() - APP/vendors/dompdf/include/
stylesheet.cls.php, line 1038
Stylesheet::_parse_css() - APP/vendors/dompdf/include/
stylesheet.cls.php, line 843
Stylesheet::load_css_file() - APP/vendors/dompdf/include/
stylesheet.cls.php, line 296
DOMPDF::_process_html() - APP/vendors/dompdf/include/dompdf.cls.php,
line 349
DOMPDF::render() - APP/vendors/dompdf/include/dompdf.cls.php, line 484
CvsController::download() - APP/controllers/cvs_controller.php, line
188
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87
Warning (2): DOMXPath::query() [domxpath.query]: Invalid expression
[APP/vendors/dompdf/include/stylesheet.cls.php, line 614]
Code | Context
$tree = Frame_Tree
$styles = array()
$xp = DOMXPath
$style = Style
$selector = "html"
$query = "//"
DOMXPath::query() - [internal], line ??
Stylesheet::apply_styles() - APP/vendors/dompdf/include/
stylesheet.cls.php, line 614
DOMPDF::render() - APP/vendors/dompdf/include/dompdf.cls.php, line 486
CvsController::download() - APP/controllers/cvs_controller.php, line
188
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87
Warning (2): Invalid argument supplied for foreach() [APP/vendors/
dompdf/include/stylesheet.cls.php, line 616]
Code | Context
$tree = Frame_Tree
$styles = array()
$xp = DOMXPath
$style = Style
$selector = "html"
$query = "//"
$nodes = false
$nodes = $xp->query($query);
foreach ($nodes as $node) {
Stylesheet::apply_styles() - APP/vendors/dompdf/include/
stylesheet.cls.php, line 616
DOMPDF::render() - APP/vendors/dompdf/include/dompdf.cls.php, line 486
CvsController::download() - APP/controllers/cvs_controller.php, line
188
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87
Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No
block-level parent found. Not good.' in /home/pulpfict/public_html/cv/
app/vendors/dompdf/include/inline_positioner.cls.php:68 Stack trace:
#0 /home/pulpfict/public_html/cv/app/vendors/dompdf/include/
frame_decorator.cls.php(382): Inline_Positioner->position() #1 /home/
pulpfict/public_html/cv/app/vendors/dompdf/include/
inline_frame_reflower.cls.php(56): Frame_Decorator->position() #2 /
home/pulpfict/public_html/cv/app/vendors/dompdf/include/
frame_decorator.cls.php(388): Inline_Frame_Reflower->reflow() #3 /home/
pulpfict/public_html/cv/app/vendors/dompdf/include/
page_frame_reflower.cls.php(96): Frame_Decorator->reflow() #4 /home/
pulpfict/public_html/cv/app/vendors/dompdf/include/
frame_decorator.cls.php(388): Page_Frame_Reflower->reflow() #5 /home/
pulpfict/public_html/cv/app/vendors/dompdf/include/
dompdf.cls.php(525): Frame_Decorator->reflow() #6 /home/pulpfict/
public_html/cv/app/controllers/cvs_controller.php(188): DOMPDF-
>render() #7 /home/pulpfict/public_ht in /home/pulpfict/public_html/cv/
app/vendors/dompdf/include/inline_positioner.cls.php on line 68
---------------------------------------------------------------------------------------------------------------------------
There are a couple of warnings and a notice (from the cakephp
framework) but those should not be important. What is making it to
crash is the Fatal error.
Please help, im getting mad with this.
Thanks
--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To post to this group, send email to
dom...@googlegroups.com.
To unsubscribe from this group, send email to
dompdf+un...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/dompdf?hl=en.