Laravel PDF: Different background images for different pages

599 Views Asked by At

I have been using barryvdh/laravel-dompdf for pdf generation. My problem is that I want to use different background images on different pages which I can't. One background image is displayed on all the pages.

<div id="watermark"><img src="{{ public_path('pdf-backgrounds/'. $settings->pdf_background_image) }}" height="100%" width="100%"></div>

Is there any solution to this?

1

There are 1 best solutions below

4
Luis Manoel On

You can create a new <body> tag to represent each new page, is not the best way but was the only way that I got when using barryvdh/laravel-dompdf.