根据内容长度从动态列宽生成mysql的pdf

时间:2013-07-11 11:22:52

标签: mysql fpdf

我正在使用FPDF库从数据库生成pdf文件,并且正在扩展PDF_MySQL_Table类以自动将数据排列到表中。但我有17列显示..所以它相互重叠..我可以让它扩展以适应内容???

这是我的代码:

<?php
require('../fpdf/mysql_table.php');
require_once('../db/connect.php');


// Page header



class PDF extends PDF_MySQL_Table

{
function Header()
{
// Logo
 $this->Image('../fpdf/ccm_inner_logo.png',10,8,33); 
// Arial bold 15
$this->SetFont('Arial','B',15);
// Move to the right
$this->Cell(30);
// Title
$this->Cell(120,15,'Member Information',1,0,'C');
// Line break
$this->Ln(20);
}   



}


$pdf=new PDF();
$pdf->AddPage();
//First table: put all columns automatically
$pdf->Table("select * from  members");
$pdf->AddPage();

$pdf->Output();
?>

任何帮助???

1 个答案:

答案 0 :(得分:0)

而不是单元格,您必须使用多单元结帐这个链接 http://www.fpdf.org/en/script/script3.php可能会帮助您

相关问题