PHPPdf icon indicating copy to clipboard operation
PHPPdf copied to clipboard

Nested styles

Open amcastror opened this issue 10 years ago • 2 comments

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:

captura de pantalla 2014-12-03 a la s 16 55 55

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!

amcastror avatar Dec 03 '14 19:12 amcastror

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>

psliwa avatar Dec 03 '14 20:12 psliwa

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

amcastror avatar Dec 03 '14 20:12 amcastror