2017-06-13 51 views
-1

我想在fpdf的圖像格式下創建。我嘗試在fpdf中爲下面顯示的圖像編寫代碼,但是當pdf進行設計時與下面的圖像不一樣。所以我怎樣才能在fpdf中設計下面的圖像格式。FPDF的設計格式

enter image description here

<?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

但是當我點擊那麼打開網址,請再次檢查,請 – Susant

+0

當我點擊,然後打開網址。請再次檢查 – Susant

+0

你試過了什麼? –

回答

0

使用HTML表格標記即可。

$html = '<table>'; 
$html .= '<tr>'; 
$html .= '<td>Receipt'; 
$html .= '</td>'; 
$html .= '</tr>'; 
$html .= '</table>';