【发布时间】:2020-08-29 09:52:18
【问题描述】:
我已经在这里阅读了很多案例,但没有任何建议的解决方案对我有用,因此我寻求一些提示/帮助。 我使用 FPDI/FPDF 的方法在单元格中放置文本,简而言之是:
public function placeTextCell($font, $fontSize, $x, $y, $red, $green, $blue, $text, $align) {
$this->pdf->SetFont($font, '', $fontSize);
$this->pdf->SetTextColor($red, $green, $blue);
$this->pdf->SetXY($x,$y);
$this->pdf->Cell(0,8,$text,0,0,$align);
}
我多次调用此方法,例如:
$this->placeTextCell('crazy-font',8,5,30,255,255,255,'the text','R');
$this->placeTextCell('crazy-font',8,5,35,255,255,255,'the text','R');
$this->placeTextCell('crazy-font',8,5,40,255,255,255,'the text','R');
.... same with different 'y' coordinate
问题是,它几乎适用于所有细胞,有些细胞错位,例如:
the text
the text
the text
the text
the text
我尝试调用 Ln(),但它没有做任何事情。 我真的不知道他们的时刻。有人知道为什么会这样吗?
【问题讨论】:
标签: php pdf pdf-generation fpdf fpdi