美文网首页
phpword+tcpdf导出pdf功能的实现借鉴

phpword+tcpdf导出pdf功能的实现借鉴

作者: 江江简书 | 来源:发表于2020-05-19 15:48 被阅读0次

生成字体

pdf生成字体:https://www.cnblogs.com/zhangyouwu/p/10381668.html

phpword简单的转pdf

phpword配置tcpdf:https://stackoverflow.com/questions/40071958/creating-pdf-from-docx-rendering-library-issue?r=SearchResults

总体的问题

https://www.mdaima.com/jingyan/67.html

常规的方法解释

https://www.cnblogs.com/relix/p/4982919.html

解决writehtml无法垂直居中的问题

  • 效果图


    image.png
  • 解决方案
$pdf->MultiCell(15, 10, '', 0, 'C', false, 0, '', '', true, 0, false, false, 60, 'M', true);
        $pdf->MultiCell(30, 10, '2.7行驶系统检查', 1, 'C', false, 0, '', '', true, 0, false, false, 60, 'M', true);  //设置一个大的复合单元格
$pdf->setXY(25, 23);  //再通过像素定位的原则解决
  • 虽然是麻烦了点但是对于严格的结构是有必要的
  • 结束语:其实tcpdf还是挺强大的,如果你遇到什么问题我觉得可以直接翻看官网的example而不是无脑的百度,这样你会得到各种无用的解决方案,虽然你有时无法实现的某些效果,但是官网基本都有替代方案

https://tcpdf.org/examples/example_057/ //官网地址

相关文章

网友评论

      本文标题:phpword+tcpdf导出pdf功能的实现借鉴

      本文链接:https://www.haomeiwen.com/subject/tpubohtx.html