<?php
include "fpdf/fpdf.php";
class PDF extends FPDF
{
var $col=0;
function SetCol($col)
{
//Pindahkan posisi ke sebuah kolom
$this->col=$col;
$x=10+$col*110;
$this->SetLeftMargin($x);
$this->SetX($x);
}
function AcceptPageBreak()
{
if($this->col<1)
{
//Ke kolom selanjutnya
$this->SetCol($this->col+1);
$this->SetY(10);
return false;
}
else
{
//Kembali ke kolom pertama dan menempatkan page break
$this->SetCol(0);
return false;
}
}
function Footer()
{
//Position at 1.5 cm from bottom
$this->SetY(-10);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Page number
$this->Cell(0,10,'Page '.$this->PageNo().'',0,0,'C');
}
}
$pdf=new PDF('P','mm',array(215,330));
$pdf->AddPage();
$pdf->SetAuthor('Lukman');
$lebar=90;
$tinggi=56;
//$image=$pdf->image('image/bg.png',$pdf->GetX(),$pdf->GetY(),$lebar,$tinggi);
$pdf->setFont("arial","B",18);
for($i=1;$i<=100;$i++)
{
if($i%10==0){
$pdf->AddPage();
}
// $pdf->Cell(0,5,"Line $i",1,1);
$pdf->image('image/bg.png',$pdf->GetX(),$pdf->GetY(),$lebar,$tinggi);
//$pdf->image('image/bg.png',$pdf->GetX(),$pdf->GetY(),$lebar,$tinggi);
$pdf->Cell($lebar,$tinggi,"Box $i",1,1,'C');
$pdf->ln(6);
}
$pdf->Output('dondong.pdf','I');
?>