How to set bottom margin in TCPDF?

久未见 提交于 2020-01-07 03:52:12

问题


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.


回答1:


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);


来源:https://stackoverflow.com/questions/45027747/how-to-set-bottom-margin-in-tcpdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!