如何在 TCPDF 中设置底边距?
问题描述:
我正在使用 TCPDF 生成 pdf.我可以使用 SetMargins($left, $top, $right = -1, $keepmargins = false)
设置左边、顶部和右边的边距,但不能设置底部边距pdf 页面.
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.
谁能帮我在TCPDF中设置下边距?任何帮助表示赞赏.
Can any one help me to set bottom margin in TCPDF? Any help is appreciated.
答
更改以下代码中 PDF_MARGIN_FOOTER、PDF_MARGIN_BOTTOM 的值(取自 TCPDF 示例):
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);