pdfpcell输出换行_fpdf 的cell 中文自动换行问题

如题

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

write 可以换行,但是没有边框

MultiCell 也可以,但是不能生成表格,一个单元格就占了一行,

下载了chinese.php

也不能结局问题,哪位帮忙看看?

回复讨论(解决方案)

你最好贴出测试代码

fpdf 偏于底层,很多东西都是要自己干预的

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');

$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');

为啥 我这个包里的 multiCell 不支持 多列呢,一个multiCell 就占一行。 而且 字体也没有text 这项呢

要不把你的包发给我一份,tstchong@163.com谢谢

我也遇到类似的问题,请大神

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值