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
Inconsistent spacing above level 2 headings #1288
Comments
Is there anything else I can do to help with this? I'm happy to test patches if it is a bug. |
So far I've been unable to reproduce the issue. Are you using any particular font? |
No, my code and HTML is exactly as above. I haven't specified a font so dompdf seems to default to Times New Roman (12pt by the looks of it). |
Well, you've tried the master branch. Want to give the develop branch a try? |
It's even less consistent if I use develop: If the heading is at the top of the page, the amount of padding following the heading is greater than if the heading is mid-page. |
Is there anything else I can do to help fix this? |
I am able to reproduce the issue at the top of the page on the develop branch. By adding the layout debugging outlines to the output (sample) I can see that the first header element has a greater height than needed. I'm not sure where that's coming from ... could be something that cascaded from the page styling, but I'll need to research this a bit more. If you add an empty block element above the affected header elements the spacing is normalized. |
Thanks, sticking an empty block (e.g. |
I used a |
Ack...I can't unsee this error! I don't know if I just didn't notice before, but now I am seeing the extra spacing in my test bed and I don't remember seeing it before. |
PHP version: 7.0.8-0ubuntu0.16.04.3
Dompdf version: 0.7.0 and master branch (as of today)
I've run into a problem with dompdf where the spacing above a level 2 heading is not always consistent. I've attached a sample PDF showing the problem - heading 5 has approximately double the spacing of the other level 2 headings.
Is there a way to fix or workaround this, or is it a limitation of dompdf (I don't mind if it's the latter, I just need to tell a client whether they can have consistent spacing or not).
sample.pdf
Code to generate the PDF:
HTML:
The text was updated successfully, but these errors were encountered: