2

I am using TCPDF for generating pdf. I am able to set margin for left,top and right using SetMargins($left, $top, $right = -1, $keepmargins = false) but not able to set margin for the bottom of the pdf page.

Can any one help me to set bottom margin in TCPDF? Any help is appreciated.

Virendra Jadeja
  • 821
  • 1
  • 10
  • 20

1 Answers1

6

change the values of PDF_MARGIN_FOOTER, PDF_MARGIN_BOTTOM in the following code (taken from TCPDF examples):

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

// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
Atara
  • 3,523
  • 6
  • 37
  • 56