1

So, I am new to fpdf. Maybe someone knows how to get an image with a variable and then insert it in a cell. There is something wrong with my sintax.

$image1 = "../_resources/img/xstampa/stampa_18_grey.png";

$stampanumero = $letterposition[$position].$image1;
$p->Cell(7, 5, $stampanumero, 1,'L');

The problem is that $image1 is printed as text ../_resources/img/xstampa/stampa_18_grey.png. It does not grab the image.

Claudiu Creanga
  • 8,031
  • 10
  • 71
  • 110
  • possible duplicate of [Inserting an image with PHP and FPDF](http://stackoverflow.com/questions/3471441/inserting-an-image-with-php-and-fpdf) – Polynomial Jul 25 '12 at 10:37

1 Answers1

4

Try this way: So create image with

$p->Cell(7, 5,$p->Image('../_resources/img/xstampa/stampa_18_grey.png',10,10,-300), 1,'L');
GBD
  • 15,847
  • 2
  • 46
  • 50