开发者

FPDF image not displaying

I tried to put an image in my pdf document, bu开发者_开发问答t when I use that method it only loading for a while, and do nothing (no errors, or such things) only a grey site...

$pdf = new FPDF();
$pdf->AddPage();
$pdf->Image('logo.png');
$pdf->Output();

So what I do wrong? If I only use text in the pdf, it's no problem, but with the Image. The Image is in the root-directory.

Edit: Added $pdf->AddPage(); as per the comment in Ewan Heming's answer.


Your example doesn't include a method call to add a page to the PDF before placing the image on it:

$pdf = new FPDF();
$pdf->AddPage();
$pdf->Image('logo.png');
$pdf->Output();


Sry guys i found out the problem , the resolution of the picture was too big

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜