So for this I am using entity print 2.2.0 with WKHTML 0.12.6 wit these patches:
"drupal/entity_print": {
"Add Export to Word Support": "https://www.drupal.org/files/issues/2019-11-22/2733781-47.patch",
"Adding page numbers in footer in pdf": "https://www.drupal.org/files/issues/2020-05-29/entity_print-custom_footer-2823430-7.patch"
}
The second one allows for a creation of a hook to add extra options and I have this:
function mymodule_print_pdf_wkhtmltopdf_options_alter(&$options) {
$header = $print_dir.'/header.html';
$footer = $print_dir.'/footer.html';
$options['header-html'] = $header;
$options['footer-html'] = $footer;
$options['enable-local-file-access'] = [$header, $footer];
}
This applies a header and footer to every page but adds to extra empty pages and the first one has two headers. The module debug route skips these options so how do I go about debugging this?
And I did try this with dompdf. It is easier, but unfortunately it doesn’t support rtl.