【问题标题】:FPDF header() image Can not open image issueFPDF header() image 无法打开图片问题
【发布时间】:2019-03-29 06:24:17
【问题描述】:

FPDF header() 图像返回错误

未捕获的异常:FPDF 错误:无法打开图像文件:xxxxx.com

我也检查了图像路径文件夹和文件权限。

请任何人帮助解决问题。

【问题讨论】:

    标签: php image fpdf


    【解决方案1】:

    将图片 URL 更改为 DOCUMENT_ROOT URL

    $ImagePath ='http:xxxxxxxxxxx.com/image/image1.png';
    

    $ImagePath = $_SERVER["DOCUMENT_ROOT"].'/image/image1.png';
    
    
    $pdf->Image($ImagePath);
    

    【讨论】:

      【解决方案2】:

      您正在定义 FPDF 的一个子类,称为 PDF,但您没有使用它。将 $pdf = new FPDF() 更改为 $pdf = new PDF()

      【讨论】:

        【解决方案3】:

        需要'LIBRARIES/FPDF/extended_fpdf.php'; $pdf = 新的 PDF ();

        $pdf->Image('ImagePath');

        获取扩展的 fpdf

        【讨论】:

          猜你喜欢
          • 2012-04-16
          • 2018-11-22
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-10-02
          • 2020-09-19
          • 1970-01-01
          • 2013-05-28
          相关资源
          最近更新 更多