barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.64k stars 292 forks source link

wkhtmltopdf 0.12.6 - Footer Not Rendered #535

Open mihir8400 opened 3 months ago

mihir8400 commented 3 months ago

wkhtmltopdf --version wkhtmltopdf 0.12.6

I'm encountering an issue with wkhtmltopdf version 0.12.6 where the footer is not rendering in generated PDF. I am trying both way using "view" and the simple way "footer-center" Code is given below.

`$mainhtml = view('web.digital_quote.generate-pdf', compact('data'))->render(); // $footerhtml = view('web.digital_quote.pdf-footer')->render(); $footerhtml = '

Hello World
';

$pdf = PDF::loadHTML($mainhtml) ->setPaper('a4') ->setOption('footer-center', $footerhtml);

$pdfName = 'digitalquote.pdf'; return $pdf->stream($pdfName); `

rentacarinmx commented 3 months ago

I have exactly the same problem here.

Duynguyennnt commented 3 months ago

You can try option 'footer-html' $pdf = PDF::loadHTML($mainhtml) ->setOption('footer-html, view('web.digital_quote.pdf-footer'));

mihir8400 commented 2 months ago

You can try option 'footer-html' $pdf = PDF::loadHTML($mainhtml) ->setOption('footer-html, view('web.digital_quote.pdf-footer'));

already done but not work, Here I want The footer remain on the last page Not each page