Hi guys,
if you often use PDF as a report builder thru PHP, may be you can solve my problem.
I’m freshmen in this case, i use PDF to create a report (i use fpdf from [url]
i use the script below and i attached the .pdf file as the result from the script below :
[COLOR=”Blue”]<?
require(‘fpdf.php’);
$conn = mysql_connect(‘localhost’,’root’,’root’);
mysql_select_db(“online_order_db”,$conn);
class PDF extends FPDF
{
function Header()
{
$this->SetFont(‘Arial’,’B’,9);
$this->SetFillColor(240,240,240);
$this->Cell(7,0.8,’Reff Code’,1,0,’C’,1);
$this->Cell(12,0.8,’Description’,1,0,’C’,1);
//$this->Cell(3,0.8,’Unit’,1,0,’C’,1);
//$this->Cell(5,0.8,’Price’,1,0,’C’,1);
$this->Ln(); // Ganti Baris
}
function Footer()
{
$this->SetY(-1.5);
$this->SetFont(‘Arial’,’B’,’9′);
$this->Cell(0,0.5,’Printed By : Arius’,0,0,’R’);
}
}
$pdf = new PDF(‘P’,’cm’,’Legal’);
$pdf->Open();
$pdf->AddPage();
$sql = “select * from product_tb order by id_product asc limit 0,40”;
$que = mysql_query($sql) or die(mysql_error());
$YPos = 2;
while($dt = mysql_fetch_array($que))
{
$pdf->Image(‘images/datascrip.jpg’,2.5,$YPos,4);
$pdf->Cell(7,2,”,1,0,’L’);
$pdf->Cell(12,2,$dt[‘IMAGE_LOW’],1,0,’L’);
$pdf->Ln();
$YPos = $YPos+2;
}
$pdf->Output();
?>[/COLOR]
Please Help Me
Thank You Very Much ?
[upl-file uuid=67f3fe4e-0113-44aa-9f98-01169b16dd4f size=5kB]doc1.pdf