We’ve using dompdf for months without any problem. Recently we had some other problems with the server (Ubuntu 16.04) and after fix them and reboot. It seems that DOMDocument has gone and we reinstall it (on PHP 7.0). But we can’t get it working again.
Our code:
$dompdf = new Dompdf();
$dompdf->loadHtml("hello world");
$dompdf->render();
$dompdf->stream("document");
After that only happen these two things:
1) When we comment $dompdf->stream() line it only shows this message:
Notice: Undefined property: DOMText::$data in /var/www/project/vendor/dompdf/src/FrameDecorator/Text.php on line 71
2) When uncomment it only generates blank PDF.
We are so lost on this for days and any kind of help will be great.
A lot of thanks at advance.
Regards.
If we use
var_dump($this->_frame->get_node());
at the line from the message (/var/www/project/vendor/dompdf/src/FrameDecorator/Text.php)
…It throws this:
object(DOMText)#1221 (17) {
["data"]=> string(0) ""
["nodeName"]=> string(5) "#text"
["nodeValue"]=> string(11) "hello world"
["nodeType"]=> int(3)
["parentNode"]=> string(22) "(object value omitted)"
["childNodes"]=> NULL
["firstChild"]=> NULL
["lastChild"]=> NULL
["previousSibling"]=> NULL
["nextSibling"]=> NULL
["attributes"]=> NULL
["ownerDocument"]=> string(22) "(object value omitted)"
["namespaceURI"]=> NULL
["prefix"]=> string(0) ""
["localName"]=> NULL
["baseURI"]=> NULL
["textContent"]=> string(11) "hello world"
}
Thanks for the help anyway. Really :)