HTML PDF template markup to create a repeating page header?

Transistor

New member
The problem

I need to generate a repeating page header (a table with the document name, etc.) on each page. If I was to generate this in PHP I would use a $pdf->function of some type.

The question

Is there any HTML markup that I can include in my DaDaBiK HTML template that TCPDF will interpret as a header or footer request and parse accordingly?





DaDaBIK version 9.4-Monterosso pro, installed on 11-22-2019 (installation code: 150615dd851a6018d8),
the latest version of DaDaBIK is 9.4-Monterosso released on 07-23-2019
You are runnning the last release of DaDaBIK
PHP Version: 5.5.9
mysql version: 5.6.11
Web server: Microsoft-IIS/7.0
Client: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
 

eugenio

Administrator
Staff member
Hello,
can you explain more in details? If you need an header and a footer for each record, you can just add that header and footer in your HTML template.

Best,
 

Transistor

New member
Caio, and thank you for your reply.

I am creating PDF documents from the Details view. The PDF document can be several pages long. I would like to create a header on each page with the document title, etc.

Also, I notice there is a horizontal rule <hr> at the top of each page. I would like to remove this.
 

eugenio

Administrator
Staff member
Oh, I understand now.

Check the "Advanced PDF customization" chapter in the documentation, you can override the header and footer method of the TCPDF class, which is what you need (there is an example about adding a logo in every page).

Best,
 

juergen_mueller

DaDaBIK Guru
Hi, you can do that by adding code similar to this to your custom template php file:

<?php

function pdf_custom_code_after_addpage($pdf)
{

$pdf->Image('images/mylogo.png', 17, 20);

}

class MYPDF extends TCPDF
{
public function Footer() {
$copyright = "© ";
$year = date ('Y');
$webtek = "my company";
$complete = "$copyright $year $webtek";

$this->Cell(40, 10, $complete);


}

public function Header() {
$this->Cell(40, 10, 'any text or variable.');
}
}


?>
 
Top