I'm using laravel-dompdf to create pdfs within my Laravel app, but I can't seem to get the static headers and footers to work. I'm using Laravel 5.8 and "barryvdh/laravel-dompdf": "^0.8.4", and I've tried the suggestions found below:
What I've tried
- https://ourcodeworld.com/articles/read/687/how-to-configure-a-header-and-footer-in-dompdf
- https://laracasts.com/discuss/channels/general-discussion/dompdf
- https://github.com/dompdf/dompdf/issues/1190
Even if I literally copy and paste the following (borrowed from here) into my html content, the package will create a pdf with two pages (as expected), but there is no header and the footer just appears once after the last of the content, not at the bottom of each page as expected.
<html>
<head>
<style>
@page { margin: 100px 25px; }
header { position: fixed; top: -60px; left: 0px; right: 0px; background-color: lightblue; height: 50px; }
footer { position: fixed; bottom: -60px; left: 0px; right: 0px; background-color: lightblue; height: 50px; }
p { page-break-after: always; }
p:last-child { page-break-after: never; }
</style>
</head>
<body>
<header>header on each page</header>
<footer>footer on each page</footer>
<main>
<p>page1</p>
<p>page2></p>
</main>
</body>
</html>
Am I missing something obvious? Any suggestions? Thanks in advance!
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3blh9i1
via IFTTT
Aucun commentaire:
Enregistrer un commentaire