'Header & footer Height with TCPDF

I have been looking everywhere but cannot find a reference to this.

Is it possible to have TCPDF automatically size the header and footer areas?

I am allowing users to create the header and footer themselves, but the height becomes an issue. I don't want to preset it too high or too low or the document will look poor.

Anybody have any ideas?

How I currently set margins:

//set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);


Solution 1:[1]

Try setting margins in the following way

$file->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

TCPDF::SetMargins ( $left, $top, $right = -1, $keepmargins = false )
Defines the left, top and right margins.

http://www.tcpdf.org/doc/code/classTCPDF.html#ab3bbdb7c85ea08d175fd559be6132ba0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 thepiyush13