【问题标题】:tcpdf image is not showing in pdftcpdf 图像未在 pdf 中显示
【发布时间】:2015-08-10 04:45:43
【问题描述】:

这是我的代码,一切正常,但徽标图像不是 pdf 格式。这是我的 PDF 生成代码。

$pdfimg->Image(''.JURI::root().'templates/camassistant_left/images/myvc_status.png', 0, 2, 250, 30, "", "", "", true, 550,'', false, false, 0, false, false, false);

【问题讨论】:

    标签: php pdf tcpdf


    【解决方案1】:

    这个

    $pdfimg->Image(''.JURI::root().'templates/camassistant_left/images/myvc_status.png', 0, 2, 250, 30, "", "", "", true, 550,'', false, false, 0, false, false, false);
    

    应该是

    $pdf->Image('images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
    

    注意:确保图像存在于路径中 (templates/camassistant_left/images/myvc_status.png)

    简介

    $pdfimg->Image 应该是$pdf->Image

    tcpdf Tutorial

    【讨论】:

    • 静止图像未显示
    • 检查图片是否正确
    • 我有更改代码 $pdf->Image('templates/camassistant_left/images/exclude.jpg', 15, 140, 75, 113, 'JPG', 'tcpdf.org', '' , true, 150, '', false, false, 1, false, false, false);
    • 检查路径是否存在。
    【解决方案2】:

    请查看您的Image() 喜欢:

    $imapePath = JURI::root().'templates/camassistant_left/images/myvc_status.png';
    Image($imapePath , 0, 2, 250, 30, '', '', '', true, 550,'', false, false, 0, false, false, false);
    

    Image() 函数示例如下:

    //Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
    

    如果您对此有任何疑问,请告诉我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-14
      • 2012-10-15
      • 1970-01-01
      • 2015-09-10
      • 2015-06-30
      • 1970-01-01
      • 2019-04-07
      • 2014-01-07
      相关资源
      最近更新 更多