KnpLabs / snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Home Page:https://knplabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Footer won't show

Th3BiSh0p opened this issue · comments

Hello,

I'm stuck with this and I can't figure out what I'm doing wrong.
I've simplified as much as I can my files, but no matter what I try, the footer won't appear.
I've searched a lot on this topic, but nothing is working. I based my files on this issue : KnpLabs/KnpSnappyBundle#48

footer :

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
Footer Content
</body>
</html>

content :

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    pdf content
</body>
</html>

my controller :

        $html = $this->renderView('bo/pdf/mini_content.html.twig');
        $footer = $this->renderView('bo/pdf/mini_footer.html.twig');
        return new Response(
            $pdf->getOutputFromHtml($html, [
                'footer-html' => $footer,
            ]),
            200,
            [
                'Content-Type' => 'application/pdf',
            ]
        );

My pdf is showing, the content is displayed, but no footer.

wkhtmltopdf 0.12.6
symfony 5.2.3
knpsnappy 1.2.1

For anyone having this issue, it has nothing to do with my files. I needed the qt patched version of wkhtmltopdf.
Install wkhtmltopdf following this : https://computingforgeeks.com/install-wkhtmltopdf-on-ubuntu-debian-linux/