snappy icon indicating copy to clipboard operation
snappy copied to clipboard

Page header and footer not working

Open Adi-18 opened this issue 1 year ago • 1 comments

I run in PHP 8.2.21, Symfony: 7.1.8 Using binary: xvfb-run /usr/bin/wkhtmltopdf versoin 0.12.6

When I try this code, there is no footer for page number

        $html = $this->renderView('pdf/pdf_report.html.twig', $parameters);

        return $knpSnappyPdf->getOutputFromHtml($html, [
            'margin-left' => 10,
            'margin-right' => 10,
            'footer-spacing' => 5,
            'footer-line' => true,
            'footer-font-size' => 3,
            'footer-center' => "Page: [page]/[toPage]",
        ]);

Adi-18 avatar Nov 13 '24 15:11 Adi-18

Hello!

I don't if it mays help you but I encountered the same issue and just discovered it was because of QT. I logged this message during the command process :

The switch --print-media-type, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'\n

(I'm using a docker environment with custom php container)

Alvyre avatar Dec 05 '24 08:12 Alvyre