Php 需要指导。TCPDF输出错误
我的TCPDF输出错误有问题,我不知道如何解决它。上面说 警告:无法修改标题信息-标题已由发送 输出从C:\xampp\htdocs\Printing\listing\u p.php:14开始 C:\xampp\htdocs\tcpdf\tcpdf.php第9043行tcpdf错误:一些数据 已输出到浏览器,无法发送PDF文件 我对TCPDF很陌生,它没有合适的教程来指导我。不过,示例并没有多大帮助 这是我的密码:Php 需要指导。TCPDF输出错误,php,tcpdf,output,Php,Tcpdf,Output,我的TCPDF输出错误有问题,我不知道如何解决它。上面说 警告:无法修改标题信息-标题已由发送 输出从C:\xampp\htdocs\Printing\listing\u p.php:14开始 C:\xampp\htdocs\tcpdf\tcpdf.php第9043行tcpdf错误:一些数据 已输出到浏览器,无法发送PDF文件 我对TCPDF很陌生,它没有合适的教程来指导我。不过,示例并没有多大帮助 这是我的密码: <?php error_reporting(E_ALL); ini_se
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>insert page</title></head>
<body>
<?php
ob_start();
require_once("../tcpdf/tcpdf.php");
require_once("../tcpdf/config/lang/eng.php");
$pdf = & new TCPDF("P","mm","A4",true,"UTF-8",false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(false);
$link = mysql_connect("localhost","root");
if(!$link){
die('Could not connect: '.mysql_error());
}
if(mysql_select_db("New_People",$link)){
mysql_query("SET NAMES utf8");
$result = mysql_query("SELECT * FROM People1");
$pdf->SetMargins(15,20,15);
$pdf->AddPage();
$pdf->SetFont('FreeSerif','B',12);
$pdf->SetFillColor(255,255,255);
$i = 0;
$max = 30;
$row_height = 5;
$backup_group = "";
$pdf->Cell(60,$row_height,'Id',1,0,'C',1);
$pdf->Cell(60,$row_height,'Code',1,0,'C',1);
$pdf->Cell(60,$row_height,'Name',1,0,'C',1);
while($row = mysql_fetch_array($result))
{
$Id = $row['P_Id'];
$Code = $row['P_Code'];
$Name = $row['P_Name'];
if($backup_group != $Id)
{
$pdf->SetFont('FreeSerif','B',12);
$pdf->Cell(120,$row_height,$Id,1,1,'C',1);
}
if($i >$max){
$pdf->AddPage();
$pdf->SetFont('FreeSerif','B',12);
$pdf->SetFillColor(255,255,255);
$pdf->Cell(60,$row_height,'Id',1,0,'C',1);
$pdf->Cell(60,$row_height,'Code',1,0,'C',1);
$pdf->Cell(60,$row_height,'Name',1,0,'C',1);
}
if(!empty($group)){
$pdf->SetFont('FreeSerif','',12);
$pdf->Cell(60,$row_height,$Id,1,0,'C',1);
$pdf->Cell(60,$row_height,$Code,1,0,'C',1);
$pdf->Cell(60,$row_height,$Name,1,0,'C',1);
}
$backup_group = $Id;
$i++;
}
mysql_close($link);
ob_end_clean();
$pdf->Output('mypdf.pdf','I');
}
else{
die("Error: ".mysql_error());
}
?>
</body>
</html>
任何建议或帮助都将不胜感激。谢谢 问题已解决,刚刚删除 需要一次../tcpdf/config/lang/eng.php 从代码的顶部来看,一切都进展顺利