Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page header and footer not working #514

Open
Adi-18 opened this issue Nov 13, 2024 · 1 comment
Open

Page header and footer not working #514

Adi-18 opened this issue Nov 13, 2024 · 1 comment
Assignees

Comments

@Adi-18
Copy link

Adi-18 commented Nov 13, 2024

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]",
        ]);

@Alvyre
Copy link

Alvyre commented Dec 5, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants