我想在fpdf下面创建图像格式。我尝试在fpdf中为该图像编写代码,如下所示,但是当pdf出现时,设计与下面的图像不同。所以我怎样才能在fpdf中设计下面的图像格式。
<?php
include("database/db.php");
$branch_name=$_POST['branch_name'];
$name=$_POST['name'];
$course=$_POST['course'];
$month=$_POST['from']. " - " .$_POST['to'];
$payment_date=$_POST['payment_date'];
extract($_POST);
$sql="Update studentfees set `paid`='{$paid}',`due`='{$due}',`month`='$month',`payment_date`='$payment_date' where roll='{$_REQUEST['roll']}'";
$result=mysql_query($sql);
date_default_timezone_set("Asia/Kolkata");
$date=date("d-m-Y");
require("fpdf/fpdf.php");
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial","",14);
$pdf->Cell(170,10,"Sigma Training Institute ",0,1,'C');
$pdf->Cell(70,10,"",0,1);
$pdf->Cell(100,10,"Candidate Copy",1,0,"C");
$pdf->Cell(70,10,"",0,1);
$pdf->Cell(70,10,"",0,1);
$pdf->Cell(20,10,"Date",1,0);
$pdf->Cell(40,10,"$date",1,0,"C");
$pdf->Cell(20,10,"",0,0);
$pdf->Cell(30,10,"Receipt No",1,0,'R');
$pdf->Cell(30,10,"$date",1,1,"R");
$sql1="Select * from studentfees where roll='{$_REQUEST['roll']}'";
$result1=mysql_query($sql1);
if($dtset=mysql_fetch_array($result1))
{
$pdf->Cell(70,10,"Candidate Name :-",0,0);
$pdf->MultiCell(110,10,$dtset['name'],0,1);
$pdf->Cell(70,10,"Candidate Course :-",0,0);
$pdf->MultiCell(110,10,$dtset['course'],0,1);
$pdf->Cell(70,10,"Total Course Fees ",0,0);
$pdf->MultiCell(70,10,$dtset['total_fee'],0,1);
$pdf->Cell(70,10,"Amout Paid:- ",0,0);
$pdf->MultiCell(70,10,$dtset['paid'],0,1);
$pdf->Cell(70,10,"Candidate Roll Number:- ",0,0);
$pdf->MultiCell(70,10,$dtset['roll'],0,1);
$pdf->Cell(70,10,"Due Amout:- ",0,0);
$pdf->MultiCell(70,10,$dtset['due'],0,1);
$pdf->Cell(70,10,"Payment Date:- ",0,0);
$pdf->MultiCell(70,10,$dtset['payment_date'],0,1);
$pdf->Cell(70,10,"",0,1);
$pdf->Cell(70,10,"_________________________________________________________________",0,1);
$pdf->Cell(70,10,"",0,1);
$pdf->output();
}
?>
答案 0 :(得分:0)
您可以使用HTML表格标签。
$html = '<table>';
$html .= '<tr>';
$html .= '<td>Receipt';
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';