{"id":1280,"date":"2022-10-22T16:31:24","date_gmt":"2022-10-22T16:31:24","guid":{"rendered":"https:\/\/mklasen.com\/?p=1280"},"modified":"2022-10-22T16:31:41","modified_gmt":"2022-10-22T16:31:41","slug":"background-size-cover-in-mpdf","status":"publish","type":"post","link":"https:\/\/mklasen.com\/background-size-cover-in-mpdf\/","title":{"rendered":"Background-size cover in mPDF"},"content":{"rendered":"\n
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.<\/p>\n\n\n\n
Usually, it’s Really, that’s it. Instead of Make sure to keep background-size out though!<\/p>\n\n\n\n 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. […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1],"tags":[],"acf":[],"yoast_head":"\nbackground-size: cover;<\/code> that solves this, but not in mPDF..<\/p>\n\n\n\n
In mPDF we use background-image-resize<\/h2>\n\n\n\n
background-size: cover;<\/code>, use
background-image-resize: 6;<\/code><\/p>\n\n\n\n
background-image-resize: 6;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"