[英]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
复制函数),否则它想从文件中读取图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.