duandang6111 2017-06-13 04:35
浏览 35

FPDF的设计格式

I want to create below the image format in fpdf. i try to write code in fpdf for that image which is shown below but when pdf comes design is not same as image below .So But How can i design the below the image format in 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();
}
?>
  • 写回答

1条回答 默认 最新

  • douaipi3965 2017-06-13 04:44
    关注

    Using HTML table tags you can.

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

报告相同问题?

悬赏问题

  • ¥15 软件工程用例图的建立(相关搜索:软件工程用例图|画图)
  • ¥15 如何在arcgis中导出拓扑关系表
  • ¥15 处理数据集文本挖掘代码
  • ¥15 matlab2017
  • ¥15 在vxWorks下TCP/IP编程,总是connect()报错,连接服务器失败: errno = 0x41
  • ¥15 AnolisOs7.9如何安装 Qt_5.14.2的运行库
  • ¥20 求:怎么实现qt与pcie通信
  • ¥50 前后端数据顺序不一致问题,如何解决?(相关搜索:数据结构)
  • ¥15 基于蒙特卡罗法的中介效应点估计代码
  • ¥15 罗技G293和UE5.3