我正在寻找有关 fpdf 的帮助。
有趣的是脚本一直运行良好,直到域移动,因为我在所有 pdf 导出上都有各种错误。
Warning: in_array() expects parameter 2 to be array, boolean given in /home/compaxit/public_html/members-area/transactions/general/basic/change_registered_office/data.php on line 88
我在不同的线路上收到了很多类似上面的警告。
最后我得到这个警告:
Warning: Cannot modify header information - headers already sent by (output started at /data.php:88) in /pdf_includes/fpdf.php on line 1017
FPDF error: Some data has already been output, can't send PDF file.
我已经尝试过这里找到的一些解决方案,但到目前为止还没有成功。
根据要求的前 10 行和后 10 行...
require('../../../../../pdf_includes/fpdf.php');
session_start();
//echo $_POST['test_1']; die;
$_SESSION['test_1'] = str_replace(" ",' ',$_SESSION['test_1']);
$_SESSION['test_2'] = str_replace(" ",' ',$_SESSION['test_2']);
$_SESSION['test_3'] = str_replace(" ",' ',$_SESSION['test_3']);
$_SESSION['test_4'] = str_replace(" ",' ',$_SESSION['test_4']);
$_SESSION['test_5'] = str_replace(" ",' ',$_SESSION['test_5']);
$_SESSION['test_6'] = str_replace(" ",' ',$_SESSION['test_6']);
$data = $_REQUEST['editor1'];
first 11 lines :)
last few:
$pdf = new PDF();
// First page
$pdf->AddPage();
$pdf->SetLeftMargin(19);
$pdf->SetRightMargin (15);
$pdf->Cell(10);
$pdf->SetFont('Arial','',10);
$pdf->WriteHTML($data);
$pdf->Output();
两者当然都包含打开的 php 标记,以下行也接收来自前一个表单的数据。$data = $_REQUEST['editor1'];
然后第 75 - 102 行,如果我认为第 88 行是正确的,我相信所涉及的错误行...
// Text
if($this->HREF)
$this->PutLink($this->HREF,$e);
elseif($this->ALIGN=='center'){
$ttt++;
$this->SetFontSize(11);
if($ttt==2 || $ttt==3){
$this->MultiCell(0,5,trim($e),0,'C',0);
} else {
$this->MultiCell(0,2,trim($e),0,'C',0);
}
}
else {
$this->SetFontSize(10);
if(in_array(trim($e),$arrSR)){
$this->SetFontSize(12);
} else {
$this->SetFontSize(10);
}
if(in_array(trim($e),$dirct)){
if($jk==0){
$y = $this->GetY();
$this->SetY($y - 2.00);
}
提前致谢