dongxu7408 2014-10-06 16:03
浏览 277
已采纳

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

So I have an image string that I insert into a webpage with a header telling the browser it is an image.

So a page would look like this:

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

http://website.com/randomString.png is used to grab the image (using .htaccess)

When I use the following code, I get the error FPDF error: Unsupported image type

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

Does anyone know what I can do to get rid of this error?

  • 写回答

1条回答 默认 最新

  • doulubashang6936 2014-10-06 16:08
    关注

    Replace Image with MemImage (and copy class from the listing below or copy the functions by itself), otherwise it wants to read image from file.

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号