Im calling wkhtmltopdf from PHP like this:
`$commandString = '
"../wkhtmltopdf/wkhtmltopdf-amd64"
--header-html '. $_SESSION['ER_HlavniLink'] .'/export_pdf/header31.php?IDstavba='.$IDstavba.'
--header-spacing 0
--footer-line
--footer-spacing 5
--footer-left "Vygenerováno pomocí webové aplikace www.estiroad.cz"
--footer-center "[page] / [toPage]"
--orientation Landscape
--user-style-sheet "../css/export.css"
--print-media-type
--page-size A4
--encoding utf-8
--margin-top 50mm
--margin-bottom 15mm
--margin-left 10mm
--margin-right 10mm
'.$_SESSION['ER_HlavniLink'].'/'.$export.' '.$nazev_sestavy;`
If I want to add a parameter in the header file call, browser shows me error: Loading of PDF document failed… Can I somehow solve this?
Based on the comments, I suggest adding double quotes around the –header-html value given. I didn’t catch that on the first testing round so thanks to your question, this might help:
This command works:
This does not (Notice that there are no quotes around the address given to –header-html