我已经使用 fpdf 库支持在 php 中创建并成功创建了我的 pdf 文件。
但问题是我的页脚显示更多空间。
我想减少文本下方的空间。我的输出是这样的:
我的代码在这里:
<?php
require('fpdf/fpdf.php');
class PDF extends FPDF {
function Header() {
$this->SetY(0.208333);
}
function Footer() {
if ($this->footer <> 1)
{
$this->SetY(-15);
}
else
{
echo "bye";
}
}
}
//class instantiation
$pdf=new PDF("l","in",array(8.5,4.17));
$pdf->SetFont('Arial','',8);
$pdf->footer = -15;
//Array2
$datas = array
(
'Address1' => array
(
'Name' => 'Vijaya',
'Area' => 'Valasaravakkam',
'City' => 'Chennai',
),
'Address2' => array
(
'Companyname' => 'Vy Systems',
'Area' => 'Valasaravakkam',
'City' => 'Chennai',
),
'Address3' => array
(
'Companyname' => 'Vy Systems1',
'Area' => 'Valasaravakkam1',
'City' => 'Chennai1',
),
);
//Array2
$datas1 = array
(
'Address4' => array
(
'Name' => 'Jaya',
'Area' => 'Valasaravakkam',
'City' => 'Chennai',
),
);
foreach($datas1 as $address1 => $details1)
{
//pdf_set_text_pos($pdf, 1240, 490);
//$pdf->ln(1);
foreach($datas as $address => $details)
{
$pdf->SetMargins(0,0,0.3);
$pdf->AddPage();
if((is_array($details)) and (is_array($details1)))
{
foreach($details1 as $rows1 => $value1)
{
$pdf->SetX(0.520833);
$pdf->MultiCell(0, 0.2, $value1, 0, "L");
}
$pdf->ln(1.96);
foreach($details as $rows => $value)
{
$pdf->SetX(5);
$pdf->MultiCell(5, 0.2, $value, 0, "L");
}
}
}//end of sub foreach
}//end of main foreach
$pdf->Output();
?>