How to Center Text in FPDF?
问题 How can I have this generated text appear centered in the page. Generated = $_POST method ... so I don't know how long will the text in input be. I need to have a pre-determined center parameter somehow. Any ideas? Maybe like this: MultiCell(0,$height,"text",0,'C') ? 回答1: Normally it's $pdf->Cell(0, $height, "text", 0, 0, 'C'); but if you're doing it in a Header or Footer function it's $this->Cell(0, $height, "text", 0, 0, 'C') . Don't forget to declare $height as a global if you're doing