Php fpdf在每行后面显示一个框
我正在使用fpdf创建pdf 我正在使用以下代码:Php fpdf在每行后面显示一个框,php,pdf,fpdf,Php,Pdf,Fpdf,我正在使用fpdf创建pdf 我正在使用以下代码: $pdf = new tFPDF(); $questions = $_POST['question']; $count = count($questions); $quests = ""; $pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true); $pdf->SetFont('DejaVu','',14); $pdf->SetTextColor(50,60,100)
$pdf = new tFPDF();
$questions = $_POST['question'];
$count = count($questions);
$quests = "";
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
$pdf->SetTextColor(50,60,100);
$pdf->AddPage('P');
$pdf->SetFontSize(12);
for($i=1;$i<=$count;$i++)
{
$qus_id = $questions[$i-1];
$get_q = "select * from `SelleXam_question` where `id`='$qus_id'";
$get_q = $wpdb->get_results($get_q);
$questf = "Quest $i : ".$get_q[0]->question;
$pdf->Cell(0, 10, iconv('UTF-8', 'windows-1252', $questf)."\n"); if($get_q[0]->image !=='') { $pdf->Ln(); $path = plugins_url(); $imagenurl = $path.'/roque/uploads/'.$get_q[0]->image; $pdf->Cell(0, 10, $pdf->Image($imagenurl,$pdf->GetX()+60, $pdf->GetY() + 5,50,50), 0, 0, 'L',''); }
$questf = "Option 1 : ".$get_q[0]->op1;
$pdf->Ln();
$pdf->Cell(0, 10, $questf."\n");
$questf = "Option 2 : ".$get_q[0]->op2;
$pdf->Ln();
$pdf->Cell(0, 10, $questf."\n");
$questf = "Option 3 : ".$get_q[0]->op3;
$pdf->Ln();
$pdf->Cell(0, 10, $questf."\n");
$questf = "Option 4 : ".$get_q[0]->op4;
$pdf->Ln();
$pdf->Cell(0, 10, $questf."\n");
$pdf->Ln();
$pdf->Ln();
}
$pdf=new tFPDF();
$questions=$_POST['question'];
$count=count($problems);
$quests=“”;
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
$pdf->SetTextColor(50,60100);
$pdf->AddPage('P');
$pdf->SetFontSize(12);
对于($i=1;$iget\u结果($get\u q);
$questf=“Quest$i:”.$get_q[0]->问题;
$pdf->Cell(0,10,iconv('UTF-8','windows-1252','questf.)“\n”);if($get_q[0]->image!=''){$pdf->Ln();$path=plugins\u url();$imagenurl=$path./roque/uploads/'.$get_q[0]->image;$pdf->Cell(0,10,$pdf->image($imagenurl,$pdf->GetX()+60,$pdf->GetY()+5,50,50),0,0,'L','';}
$questf=“选项1:”.$get_q[0]->op1;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$questf=“选项2:”.$get_q[0]->op2;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$questf=“选项3:”.$get_q[0]->op3;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$questf=“选项4:”.$get_q[0]->op4;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$pdf->Ln();
$pdf->Ln();
}
pdf已创建,但当我显示pdf时,会在该行末尾创建一个小框,pdf示例如下:
如何删除这些框?删除字符串末尾的“\n”。单元格()不支持多行,tFPDF似乎不正确地将字符子集化,或将其替换为缺少的字形字符