php TCPDF 设置底部边距为零
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15779856/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TCPDF set bottom margin zero
提问by Shijin TR
I am creating pdf using TCPDF in php,I need to include my data into pdf without bottom margines,The data will be included at the end of the page.
我在 php 中使用 TCPDF 创建 pdf,我需要将我的数据包含在没有底部边距的 pdf 中,数据将包含在页面的末尾。
$pdf->SetLeftMargin(14);
$pdf->SetTopMargin(6);
$pdf->SetFont($fontname, '', '9');
$pdf->setPrintHeader(false);
$pdf->SetFooterMargin(0);
$pdf->setPrintFooter(false);
$pdf->AddPage();
$pdf->writeHTML($html, true, 0, true, 0);
I am using the above code.Anyone know how to remove margin space from pdf using tcpdf?
我正在使用上面的代码。有人知道如何使用 tcpdf 从 pdf 中删除边距空间吗?
回答by mukund
Margin that you are seeing is due to pageBreak margin
您看到的边距是由于 pageBreak 边距
Add this $pdf->SetAutoPageBreak(TRUE, 0);definitely remove margin from bottom
添加这个$pdf->SetAutoPageBreak(TRUE, 0);肯定会从底部删除边距
回答by thumber nirmal
try this
尝试这个
$pdf->setCellPaddings(0,0,0,0);
read this... you will get some idea....http://www.tcpdf.org/examples/example_022.phps
读这个...你会得到一些想法.... http://www.tcpdf.org/examples/example_022.phps

