繁体   English   中英

FPDF错误:不支持的图像类型(使用标头定义图像时)

[英]FPDF error: Unsupported image type (while using header to define image)

因此,我将图像字符串插入到网页中,并在标题中告诉浏览器它是图像。

因此页面如下所示:

<?php
    header('Content-Type: image/png');
    echo $image_data;
?>

http://website.com/randomString.png用于抓取图像(使用.htaccess)

当我使用以下代码时,出现错误FPDF error: Unsupported image type

$imagePath = file_get_contents("http://website.com/".$randomString.".png");
$pdf->Image($imagePath,159,185,27);

有谁知道我该怎么做才能摆脱这个错误?

MemImage替换Image (并复制下面列表中的类,或MemImage复制函数),否则它想从文件中读取图像。

http://www.fpdf.org/en/script/script45.php

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM