【问题标题】:Tcpdf image not showing while using in codeigniter在 codeigniter 中使用时未显示 Tcpdf 图像
【发布时间】:2015-06-30 01:49:20
【问题描述】:

我正在使用 TCPDF 并从 MySQL 表行中获取内容,该行包含 HTML,例如:

<p>Internet users are our primary target market. We do not charge the consumer any fee
for using our services or to make purchases online. We do not add any fee or commission on products that you compare and purchase online</p>
<p><img src="http://1/2/3/x.jpg" width="x" height="x"></p>

【问题讨论】:

  • 请澄清您的具体问题或添加其他详细信息以准确突出您的需要。问题是什么?这个 HTML 与 TCPDF 和 Codeigniter 有什么关系?
  • 显示你的代码并添加图片

标签: php image codeigniter pdf tcpdf


【解决方案1】:

请尝试使用 div >image 或 table >> tr > td > image 其他标签而不是 p > image (包含图片标签)

【讨论】:

    【解决方案2】:

    在 Tcpdf 中确保你的路径是相对路径而不是 http 路径 前

    realpath(APPPATH."../1/2/3/x.jpg")

    【讨论】:

      【解决方案3】:

      通过给出图像的相对路径而不是给出绝对路径,看看下面的代码。我认为它应该很有用。

      <img src="<?php echo 'layouts/images/'.$decscript ?>"/>
      

      【讨论】:

        【解决方案4】:

        TCPD 不支持绝对路径。你必须使用相对路径。

        PHP中使用realpath函数

        其他要查看的内容,从脚本读取图像的权限。您必须将权限 chmod 设置为 777 或 755 才能包含文件夹的图像。

        【讨论】:

        • 如果我的回答对您有用,请将其标记为正确,以帮助其他面临同样问题的人。很乐意提供帮助。
        猜你喜欢
        • 2012-01-14
        • 2012-10-15
        • 2015-10-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多