It’s saturday today, and I found some time to work on some side projects.. This one is about generating PDF’s from HTML and.. I wanted to use a full-width background image that keeps the original ratio.
Usually, it’s background-size: cover;
that solves this, but not in mPDF..
In mPDF we use background-image-resize
Really, that’s it. Instead of background-size: cover;
, use background-image-resize: 6;
Make sure to keep background-size out though!
background-image-resize: 6;
Adeleke Adelani says
Worked perfectly