Skip to content
Advertisement

Style is not recognized when using mpdf

Here is my code:

JavaScript

Output:

enter image description here

I need it.

enter image description here

How to fix it. Creating a css file is difficult for me because I use different styles on all tags.

Advertisement

Answer

You’re using an older version of mPDF. Its current stable release is 2 major versions ahead of the version you’re using.

Your code contains a typo. Change $htmls to $html.

When I test your code with mPDF 8(.0.7), things work swimmingly, and this is the output I get:

Output from my test of your fixed code with mPDF 8

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement