-
-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOMPDF_Exception "No block-level parent found. Not good." #137
Comments
I'm having a similar issue when using the loadView method: DOMPDF_Exception in inline_positioner.cls.php line 37: |
DOMPDF_Exception in inline_positioner.cls.php line 37: What is the problem? |
Here's how I'm using loadView: $pdf = \App::make('dompdf.wrapper'); Here's the stack trace I'm getting: in inline_positioner.cls.php line 37 |
Guys, the problem in CSS. |
Worked for me too. |
I was able to fix this error by remove this CSS definition in de body section
Switched everything back on, even the fonts (who are responsible for massive delay when included) and it worked, so the display:table is the culprit here. |
Also try to prevent line breaks in your template (if you're using one) - this caused this error in my case. |
I have this problem on Mac OS X using any PHP version and libxml2 2.9.5 (I have different PHP versions compiled against it). I used the ugly hack for strip spaces between tags. The bug is detailed on this dompdf issue: dompdf/dompdf#1494 |
Thanks for that link @vaites I used another better solution on that page which is:
You have to set option enable_html5_parser to true, then it works again with libxml2 2.9.5 or newer. |
Dompdf was working fine with php5.5.12 but on changing php version to 7.0.25 it stopped working and throwing this error. An uncaught Exception was encountered Type: DOMPDF_Exception Message: No block-level parent found. Not good. Filename: D:\wamp\www\ci316\application\libraries\dompdf\include\inline_positioner.cls.php Line Number: 37 How to resolve this???? I removed all css still not working. |
Removing the entire HEAD section fixed my issue. Use inline styles, like an EDM. |
After resolving all errors i am getting this error please give solution how to resolve this issue An uncaught Exception was encountered Type: DOMPDF_Exception Message: No block-level parent found. Not good. Filename: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\inline_positioner.cls.php Line Number: 37 Backtrace: File: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\frame_decorator.cls.php File: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\text_frame_reflower.cls.php File: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\frame_decorator.cls.php File: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\page_frame_reflower.cls.php File: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\frame_decorator.cls.php File: C:\xampp\htdocs\pdf_invoice\application\libraries\dompdf\include\dompdf.cls.php File: C:\xampp\htdocs\pdf_invoice\application\controllers\Welcome.php File: C:\xampp\htdocs\pdf_invoice\index.php |
The solution from @frin seems to be doing the trick! Better than debugging your html template. |
I fixed with "composer update" |
I solved , deleting tag |
Hi,
|
This a message that i found on log after enable the log: And this is the code near line 32:
|
Just got this after a libxml2 update to 2.9.7. |
Change:
To:
in /vendor/barryvdh/laravel-dompdf/src/PDF.php Notice: |
I didn't find any barryvdh/laravel-dompdf/src/PDF.php or public function loadView using grep. Mine is dompdf, and on folder vendor there is only these folders: Any idea? |
Had the same issue, for me it was caused by the |
"No block-level parent found. Not good."-if this is ur problem then the given below is one of its solution Change lines 122 to 125 in /vendor/barryvdh/laravel-dompdf/src/PDF.php
To
|
NEVER change the code in your vendor folder. A pull request may be better than that. The next time you try to update the code, it will override the change and you are back to square 1. Plus how will you deploy? Normally the vendor folder is not supposed to be version controlled, so your change will not go beyond your local code. My fix came with adding the following styling in the template: |
Enable before parsing via load_html(); solved it for me. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
try to minimize the HTML template for PDF (it will remove all the spaces and white spaces etc) |
I was facing this same issue with Laravel 5.4 and "barryvdh/laravel-dompdf": "^0.7.1", but later I updated the version of dompdf to "barryvdh/laravel-dompdf": "^0.8", and issue resolved. |
Hi, im working on a project and I'm using your dompdf to create and render PDFs. Rendering PDFs is a success on my localhost but what's odd is it throws
DOMPDF_Exception "No block-level parent found. Not good."
error on live server. Any idea how to fix this?Im using
loadView()
function..The text was updated successfully, but these errors were encountered: