// Calculate width of text and position
$w = $this->GetStringWidth($title)+6;
$this->SetX((210-$w)/2);
// Line break
$this->Ln(10);
$title = 'YOUR TEXT HERE';
$this->SetTitle($title);
$this->SetTextColor(0,0, 0);
$this->SetFont('Arial','',17);
$this->SetX(((210-$w)/4),(-50));
$this->Cell(10, 20, $title);
5条答案
按热度按时间uurv41yg1#
通常它是
$pdf->Cell(0, $height, "text", 0, 0, 'C');
,但是如果你在Header或Footer函数中这样做,它是$this->Cell(0, $height, "text", 0, 0, 'C')
,如果你在function()调用中这样做,不要忘记声明$height
为全局变量。tkqqtvp12#
谢谢你,托尔!这对我很有效:
qgzx9mmu3#
这可能对你有用
oug3syen4#
6ovsh4lw5#
全局$标题;