Annoying bug of FPDF :: MultiCell()

耗尽温柔 提交于 2019-12-12 03:08:55

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!