PHPPdf
PHPPdf copied to clipboard
Nested styles
Hi, I'm trying to render this html into a pdf:
<p><strong>bold</strong> <i><strong>both</strong></i> <i>italic</i></p>
But I'm getting this:

Looks like when using nested elements ("strong" inside an "i") it will respect only the outermost element.
I tried this with span elements with clases giving the styles, but same result.
Any ideas? Thanks a lot!
https://github.com/psliwa/PHPPdf#known-limitations - nested linear tags (text, span, code, page-info, page-number, a, b, i, em) are not properly supported. If one linear tag contains another, only text within this tags is merged, styles are taken from the most outer linear tag.
If you want to achieve bold and italic text, you should use font-style attribute.
<p><strong>bold</strong> <span font-style="bold-italic">both</span> <i>italic</i></p>
Wow, sory about that, I should have looked better.
Thanks a lot anyway!
El miércoles, 3 de diciembre de 2014, Piotr Śliwa [email protected] escribió:
https://github.com/psliwa/PHPPdf#known-limitations - nested linear tags (text, span, code, page-info, page-number, a, b, i, em) are not properly supported. If one linear tag contains another, only text within this tags is merged, styles are taken from the most outer linear tag.
If you want to achieve bold and italic text, you should use font-style attribute.
bold both italic
— Reply to this email directly or view it on GitHub https://github.com/psliwa/PHPPdf/issues/82#issuecomment-65480129.
Saludos, Matías Castro Dsarhoya