问题
I've just encountered a very strange bug of FPDF. My code is:
$PDF = new FPDF('P', 'mm', 'A4');
$PDF->SetXY(0,0);
$PDF->MultiCell(40, 5, "WE WANT TO SERVE YOU BETTER", 1, 'R');
for right alignment and the same:
$PDF->MultiCell(40, 5, "WE WANT TO SERVE YOU BETTER", 1, 'C');
for Center alignment. What I get, is presented on the following screenshot: http://img3.fotos-hochladen.net/uploads/fpdf9rwucik1xh.png with "right" and "Center" alignment respectively. It aligns not absolutely but relative to the right border of the multicell.
What's more, the automatic line break doesn't work.
Just noticed, same alignment bug is there also in the Cell method.
Having wasted two hours I found nothing on the Internet. Please help to fix.
回答1:
Solution found. I had to set any font.
To be honest, it was very annoying. But if someone else runs the same problem, will not any more waste time for that!
来源:https://stackoverflow.com/questions/15386068/annoying-bug-of-fpdf-multicell