fpdf 的cell 中文自动换行问题

redword 2013-07-19 04:26:01
如题

cell 里面的中文不能自动换行是为啥?怎么设置

write 可以换行,但是没有边框
MultiCell 也可以,但是不能生成表格,一个单元格就占了一行,


下载了chinese.php

也不能结局问题,哪位帮忙看看?
...全文
894 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
baidu_26912893 2015-03-30
  • 打赏
  • 举报
回复
我也遇到类似的问题,请大神
redword 2013-07-19
  • 打赏
  • 举报
回复
要不把你的包发给我一份,tstchong@163.com谢谢
redword 2013-07-19
  • 打赏
  • 举报
回复
为啥 我这个包里的 multiCell 不支持 多列呢,一个multiCell 就占一行。 而且 字体也没有text 这项呢
xuzuning 2013-07-19
  • 打赏
  • 举报
回复
$y = $p->gety();
$x = $p->getx();
$p->setfont('text', '', 12);
$p->MultiCell(60,40,'中文单元格内容',1,'C');
$p->setxy($x+60,$y);
$p->MultiCell(60,40,'中文单元格内容',1,'C');
redword 2013-07-19
  • 打赏
  • 举报
回复

require './fpdf17/chinese.php';

$pdf=new PDF_Chinese();
$pdf->AddPage();
$pdf->AddGBFont();
$pdf->SetFont('GB','', 20);
$txt="helloworldhelloworldhelloworl\n ln dhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld";

$txt=htmlspecialchars($txt); //转换HTML关键字符
$txt=nl2br($txt);

$txt= iconv('utf-8', 'gb2312', $txt);

//$pdf->Write(10,$txt);

$pdf->Cell (80,20,$txt,1,1,'C');
$pdf->Output("test.pdf",'D');

xuzuning 2013-07-19
  • 打赏
  • 举报
回复
你最好贴出测试代码 fpdf 偏于底层,很多东西都是要自己干预的

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧