Header / Footer with node variables / fields

Created on 2 April 2014, over 11 years ago
Updated 20 June 2025, about 1 month ago

See http://mpdf1.com/manual/index.php?tid=313 ...
You can place tags for headers and footers into the node:

<!--mpdf
<htmlpageheader name="firstPageHeader">
<div style="text-align: right; border-bottom: 1px solid #000000; font-weight: bold; font-size: 10pt;">My document</div>
</htmlpageheader>

<htmlpageheader name="PageHeader">
<div style="border-bottom: 1px solid #000000; font-weight: bold;  font-size: 10pt;">My document</div>
</htmlpageheader>

<htmlpagefooter name="firstPageFooter">
<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt;
    color: #000000; font-weight: bold; font-style: italic;"><tr>
    <td width="33%"><span style="font-weight: bold; font-style: italic;">{DATE j-m-Y}</span></td>
    <td width="33%" align="center" style="font-weight: bold; font-style: italic;">{PAGENO}/{nbpg}</td>
    <td width="33%" style="text-align: right; ">My document</td>
    </tr></table>
</htmlpagefooter>

<sethtmlpageheader name="firstPageHeader" value="on" show-this-page="1" />
<sethtmlpageheader name="PageHeader" value="on" />
<sethtmlpagefooter name="PageFooter" value="on" />
mpdf-->

this gives additional possibilities:
- print a different header for first page
- printing node variables / fields into the header / footer area of the pdf

maybe it would be nice to have on the admin configuration page two additional checkboxes with a link to the documentation of mpdf:
- use node template to store the header(s)
- use node template to store the footer(s)

with an additional condition for this structure in the module code:

Enabling header option if available.
$header = variable_get('pdf_using_mpdf_pdf_header');
if (isset($header) && $header != NULL) {
    $mpdf->SetHTMLHeader($header);
}

Enabling Footer option if available.
$footer = variable_get('pdf_using_mpdf_pdf_footer');
if (isset($footer) && $footer != NULL) {
    $mpdf->SetHTMLFooter($footer);
}

thanks and br sb

Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇩🇪Germany sachbearbeiter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024