Answers.Body: <p>That error is coming from dompdf, bundled with CiviCRM.</p>
  
  <p>Here are a couple of references to that error outside of CiviCRM:</p>
  
  <pre>https://github.com/dompdf/dompdf/issues/902
  https://github.com/barryvdh/laravel-dompdf/issues/389</pre>
  
  <p>The error happens for both 4.6 and 4.7, different php, so the trigger to the issue appears to be somewhat removed.</p>
  
  <p>I fixed one case using the pdf setting (here: /civicrm/admin/setting/misc?reset=1). Using the wkhtmltopdf binary instead of the dompdf bundled with CiviCRM solved the issue.</p>
  
  <p>I upgraded to the latest 4.7.27 version with an updated dompdf, and that did not solve the issue, but instead generated a new problem of running out of memory.</p>
  
  <p>I did a bit more research and fixed the 4.6 version of the problem by removing whitespace in the html that is being fed into dompdf, in the file CRM/Utils/PDF/Utils.php, as per the suggestion by benabbotnz in the second issue linked above.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T18:50:14.203Z
Answers.Text: FYI dompdf was updated in 4.7.24 by CRM-20960
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T19:28:36.167Z
Answers.Text: Thanks - I'll have to see if that solves this error, I'm due to upgrade shortly.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-03T20:26:42.867Z
Answers.Text: Upgrade to 4.7.27 converted the issue into one of running out of memory (I would think 128 Mb should be enough ...).
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-07T22:14:22.633Z
Answers.Text: The fix suggested work in 4.7.x, too.
Answers.UserDisplayName: BruceW
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T17:39:45.817Z
Answers.LastActivityDate: 2017-11-03T20:24:07.897Z
Answers.LastEditDate: 2017-11-03T20:24:07.897Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>If you’re running out of memory, as per the comment in the other answer, apply this patch to dompdf (a project external to CiviCRM which you’ll find in the CiviCRM vendor directory).</p>
  
  <p><a href="https://github.com/dompdf/dompdf/pull/1570/files" rel="nofollow noreferrer">https://github.com/dompdf/dompdf/pull/1570/files</a></p>
  
  <p>Note: this patch has been merged into dompdf master, so it will be included in the CiviCRM code base in an upcoming release.</p>
  
  <p>The patch above fixed the out-of-memory-problem for 4.7.27 (can now hit Print Invoice again).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-04T16:33:42.107Z
Answers.LastActivityDate: 2017-11-06T15:58:09.787Z
Answers.LastEditDate: 2017-11-06T15:58:09.787Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>Using 4.7.22 and Drupal 7, I'm suddenly getting the fatal error "No block-level parent found. Not good" on various pdf generation screens (for example: when hitting Print Invoice button):</p>
  
  <p><a href="https://i.sstatic.net/BHdXX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BHdXX.png" alt="error screen"></a></p>
  
  <p>It started after a recent update to my OS (Centos6).</p>
  
Tags: <pdf><invoice>
Title: Error: No block-level parent found. Not good
ThreadText: # Error: No block-level parent found. Not good
  
  (Asked by: username_0 on 2017-11-01)
  
  Using 4.7.22 and Drupal 7, I'm suddenly getting the fatal error "No block-level parent found. Not good" on various pdf generation screens (for example: when hitting Print Invoice button):
  
  [![error screen](https://i.sstatic.net/BHdXX.png)](https://i.sstatic.net/BHdXX.png)
  
  It started after a recent update to my OS (Centos6).
  
  **Tags:** pdf, invoice
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-11-01. Score: 4
  
  That error is coming from dompdf, bundled with CiviCRM.
  Here are a couple of references to that error outside of CiviCRM:
  https://github.com/dompdf/dompdf/issues/902
  https://github.com/barryvdh/laravel-dompdf/issues/389
  The error happens for both 4.6 and 4.7, different php, so the trigger to the issue appears to be somewhat removed.
  I fixed one case using the pdf setting (here: /civicrm/admin/setting/misc?reset=1). Using the wkhtmltopdf binary instead of the dompdf bundled with CiviCRM solved the issue.
  I upgraded to the latest 4.7.27 version with an updated dompdf, and that did not solve the issue, but instead generated a new problem of running out of memory.
  I did a bit more research and fixed the 4.6 version of the problem by removing whitespace in the html that is being fed into dompdf, in the file CRM/Utils/PDF/Utils.php, as per the suggestion by benabbotnz in the second issue linked above.
  
  > **Comments:**
  > **username_1**: FYI dompdf was updated in 4.7.24 by CRM-20960  
  > **username_0**: Thanks - I'll have to see if that solves this error, I'm due to upgrade shortly.  
  > **username_0**: Upgrade to 4.7.27 converted the issue into one of running out of memory (I would think 128 Mb should be enough ...).  
  > **username_2**: The fix suggested work in 4.7.x, too.  
  
  ---
  
  ### Answer by username_3 on 2017-11-04. Score: 2
  
  If you’re running out of memory, as per the comment in the other answer, apply this patch to dompdf (a project external to CiviCRM which you’ll find in the CiviCRM vendor directory).
  
  <https://github.com/dompdf/dompdf/pull/1570/files>
  
  Note: this patch has been merged into dompdf master, so it will be included in the CiviCRM code base in an upcoming release.
  
  The patch above fixed the out-of-memory-problem for 4.7.27 (can now hit Print Invoice again).
  
  
  ---
  
  