I have tried a number of different methods to add a header which I would like to appear on every page but no matter what I've tried nothing seems to work.
I am passing in a HTML string for the body and I have created an endpoint which outputs the example header html from the wkhtmltopdf documentation with the doctype included
https://wkhtmltopdf.org/usage/wkhtmltopdf.txt
However it still does not work. I have also tried setting an extraParam with key "--header-html" and value of my endpoint but that also did not work.
I have also tried using a url for the body so that both the header and body are using URLs but this also did not work.
From googling it appears the wkhtmltopdf binary might require the --header-html parameter as the very first parameter and from looking in integration studio I saw that it is not set as the first parameter. I tried to compile the code but it fails compilation even without me making any changes.
Does anyone know what can be done to help debug why it's not working.
function subst() { var vars = {}; var query_strings_from_url = document.location.search.substring(1).split('&'); for (var query_string in query_strings_from_url) { if (query_strings_from_url.hasOwnProperty(query_string)) { var temp_var = query_strings_from_url[query_string].split('=', 2); vars[temp_var[0]] = decodeURI(temp_var[1]); } } var css_selector_classes = ['page', 'frompage', 'topage', 'webpage', 'section', 'subsection', 'date', 'isodate', 'time', 'title', 'doctitle', 'sitepage', 'sitepages']; for (var css_class in css_selector_classes) { if (css_selector_classes.hasOwnProperty(css_class)) { var element = document.getElementsByClassName(css_selector_classes[css_class]); for (var j = 0; j < element.length; ++j) { element[j].textContent = vars[css_selector_classes[css_class]]; } } } }
Hi Aaron, were you able to solve your problem with adding headers? I am also in need and I am not succeeding. Tks.