snappy
snappy copied to clipboard
Page header and footer not working
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]",
]);
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)