PHP 7.0 and 7.1 PDF error with Craft Commerce orders Switching over to a new server and using PHP 7.0 (and 7.1) everything looked to be fine until I tried to view an order PDF within an email from Craft Commerce. Even using the email template provided by the plugin. The error is:

No block-level parent found. Not good.


I can't remember which DOM-PDF issue thread I came across it in, but the solution is to remove 

&lt;head&gt;&lt;/head&gt; 


from the document. Does anyone know of a more elegant solution? I don't think it's my server.
I came across the same issue yesterday. After a bit of reading and trial and error I found the most elegant way for now is to remove the white space between these elements. 

&lt;html&gt;&lt;head&gt;
&lt;/head&gt;&lt;body&gt;
&lt;/body&gt;&lt;/html&gt;


Personally I achieved this by adding comments &lt;!--  --&gt; between to remove the white space

&lt;html&gt;&lt;!--
--&gt;&lt;head&gt;
&lt;/head&gt;&lt;!--
--&gt;&lt;body&gt;
&lt;/body&gt;&lt;!--
--&gt;&lt;/html&gt;


I piked this up from this thread initially. 
https://github.com/barryvdh/laravel-dompdf/issues/389

I think that the proper solution might be to enable the html5 parser, but I think this might be a config setting within the DomPDF? Would this fall ino the Craft Commerce files?


"enable_html5_parser" =&gt; true,