bikin pdf pake php

buat temen2 yan9 uDah tau ..
maaf ya kLo aku share La9i .. sunny

Lan9kah - Lan9kah'nYa :
1. bUat f0Lder, kaSi naMa modulpdf
2. didaLam foLder tErsEbut kaSi foLder iNi : biSa diD0wnLoad di kLik diSini
3. kasi iNi jU9a kLik siNi
4. kasi gambar dengan nama : logo_pb.png
5. bUat php, kaSi nama : tespdf.php
kode php'nYa :

Spoiler:

require ('fpdf/fpdf.php');
//class baru yang merupakan turunan dari kelas FPDF
class PDF extends FPDF
{
//buat page header
function Header()
{
//masukan gambar
$this->image('logo_pb.png',10,8,33);
//set font menjadi arial bold 15
$this->setfont('Arial','B',15);
//move to the right
$this->Cell(80);
//title
$this->Cell(30,10,'Title',1,0,'c');
//line break
$this->Ln(20);
}

//buat page footer
function Footer()
{
//position at 1.5cm from bottom
$this->SetY(-15);
//arial italic 8
$this->SetFont('Arial','I',8);
//page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
//instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
//tulis teks sederhana pada file pdf
for($i=1;$i<=40;$i++)
$pdf->cell (0,10,'Printing line number '.$i,0,1);
//output file pdf ke browser
$pdf->Output();
?>


seLamat mEnc0ba.. Smile
saYa yaKin, aNda LebiH kReaTif daRi saYa sunny sunny

0 comments:

Posting Komentar

R3B3L - Design by : R3B3L @ 2010 - 2011 All Rights Reserved [+] We Are Black Hat [+]