Reputation: 906
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);
Upvotes: 2
Views: 9221
Reputation: 1331
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.
https://tcpdf.org/docs/srcdoc/TCPDF/classes-TCPDF/#method_setMargins
Upvotes: 1